diff options
Diffstat (limited to 'examples/utf8replace_rs.rs')
| -rw-r--r-- | examples/utf8replace_rs.rs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/examples/utf8replace_rs.rs b/examples/utf8replace_rs.rs deleted file mode 100644 index 717978aa..00000000 --- a/examples/utf8replace_rs.rs +++ /dev/null @@ -1,19 +0,0 @@ - -pub fn main() { - let mut hello = String::from("hell😀 world"); - println!("{}", hello); - - hello.replace_range( - hello - .char_indices() - .nth(4) - .map(|(pos, ch)| (pos..pos + ch.len_utf8())) - .unwrap(), - "🐨", - ); - println!("{}", hello); - - for c in hello.chars() { - print!("{},", c); - } -} |
