About 50 results
Open links in new tab
  1. How do I change characters at a specific index within a string in …

    Mar 16, 2021 · I am trying to change a single character at a specific index in a string, but I do not know how to in rust. For example, how would I change the 4th character in "hello world" to 'x', …

  2. How do I replace specific characters idiomatically in Rust?

    Jan 5, 2016 · How do I replace specific characters idiomatically in Rust? Asked 9 years, 9 months ago Modified 4 years ago Viewed 108k times

  3. rust - Modifying chars in a String by index - Stack Overflow

    Oct 24, 2014 · In fact, there is no way to do this in-place correctly, because any character conversions may change the number of bytes the character occupy, and this would require full …

  4. rust - Edit string in place with a function - Stack Overflow

    Dec 6, 2014 · In Rust strings are valid UTF-8 sequences, and UTF-8 is a variable-width encoding. Consequently, in general changing a character may change the length of the string in bytes.

  5. How to convert a Rust char to an integer so that '1' becomes 1?

    How to convert a Rust char to an integer so that '1' becomes 1? Asked 8 years, 5 months ago Modified 4 years, 7 months ago Viewed 122k times

  6. rust - Convert a char to upper case - Stack Overflow

    Feb 16, 2016 · Rust strings handle both Unicode and UTF-8, but at different layers. In Unicode, one lowercase character doesn't always map to a single uppercase character. For example: 'ß' …

  7. Why is capitalizing the first letter of a string so convoluted in Rust ...

    So doing this with Rust's standard library is even harder than you initially thought. However, Rust is designed to encourage code reuse and make bringing in libraries easy. So the idiomatic way …

  8. How do i convert to ascii in RUST - Stack Overflow

    Feb 24, 2023 · Unclear what it is you're asking. The representation of 'A' in most code pages, including ASCII and UTF-8 (rust's internal encoding) is a code unit with the value of 65 …

  9. How to remove first and last character of a string in Rust?

    Jan 31, 2021 · How to remove first and last character of a string in Rust? Asked 4 years, 8 months ago Modified 1 year, 5 months ago Viewed 67k times

  10. How do you iterate over a string by character - Stack Overflow

    Mar 3, 2014 · 166 I have a string and I need to scan for every occurrence of "foo" and read all the text following it until a second ". Since Rust does not have a contains function for strings, I …