Strings in Rust

  1. Create a String
  2. Create empty string and grow it using push and push_str
  3. Length of string
  4. Capacity of string
  5. Strings and memory allocation
  6. Rust - string ends with
  7. Rust - string starts with
  8. To lower, to upper case
  9. Accessing characters in a string
  10. Rust - string slices
  11. Rust - string characters
  12. Iterate over the characters of a string
  13. Rust - reverse string
  14. Concatenation str with str
  15. Concatenation String with String
  16. Concatenation String with String (clone)
  17. Concatenation String with str
  18. Concatenate strings using format!
  19. concat
  20. Split string
  21. Split string on whitespace
  22. Split on newlines - use lines
  23. Append to string with push_str
  24. Create String from literal string using to_string
  25. Str and String equality
  26. String notes
  27. String replace all
  28. String replace limited times
  29. String replace range
  30. Function to combine two strings
  31. Ownership and strings
  32. Slice and change string
  33. Compare strings
  34. Is one string in another string - contains?
  35. Embed double quotes in string
  36. Remove leading and trailing whitespace
  37. Remove extra whitespace from string
  38. String is alphabetic or alphanumeric
  39. Compare memory address (pointer)
  40. Exercise: Count digits from string
  41. Exercise: concatenate strings
  42. Exercise: is it a palindrome?
  43. Exercise: is it an anagram?
  44. Exercise: Get nth double character
  45. Exercise: get first word
  46. Solution: Count digits from string