mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-23 05:49:22 +00:00
19 lines
518 B
Rust
19 lines
518 B
Rust
//! # String utilities
|
|
//!
|
|
//! This module contains utilities that can be used accross all the application
|
|
|
|
/// Escape an HTML string
|
|
///
|
|
/// Removes the HTML code included inside a string
|
|
///
|
|
/// ```
|
|
/// use comunic_server::utils::string_utils::remove_html_nodes;
|
|
///
|
|
/// let s1 = "<b>hello world</b>";
|
|
/// let res1 = remove_html_nodes(s1);
|
|
/// assert_eq!(res1, "<b>hello world</b>");
|
|
/// ```
|
|
pub fn remove_html_nodes(input: &str) -> String {
|
|
input.replace("<", "<")
|
|
.replace(">", ">")
|
|
} |