Swift String

Swift String is a series of characters. For example "Hello World" is a string.

The following are the list of tutorials that deal with different concepts of strings, like creating strings, transforming them, etc.

Basics

  1. Swift – Create a string variable
  2. Swift – Create an empty string
  3. Swift – Create multiline string
  4. Swift – String length
  5. Swift – Append a string to another string
  6. Swift – Concatenate strings
  7. Swift – Compare strings
  8. Swift – Escape double quotes in string
  9. Swift – Include variable in string
  10. Swift – Loop over characters in string
  11. Swift – Substring

Checks

  1. Swift – Check if two strings are equal
  2. Swift – Check if two strings are not equal
  3. Swift – Check if string is empty
  4. Swift – Check if string contains substring
  5. Swift – Check if string starts with a specific prefix
  6. Swift – Check if string ends with a specific suffix
  7. Swift – Check if variable type is string

Transformations / Modifications

  1. Swift – Convert string to lowercase
  2. Swift – Convert string to uppercase
  3. Swift – Insert character at specific index in string
  4. Swift – Remove character at specific index in string
  5. Swift – Remove last character in string
  6. Swift – Remove prefix from a string
  7. Swift – Remove specific character(s) from string
  8. Swift – Repeat a string for n number of times
  9. Swift – Reverse string
  10. Swift – Split string by character
  11. Swift – Split string by comma
  12. Swift – Split lines in a string into an array
  13. Swift – Trim whitespaces from edges of string

Replacements

  1. Swift String – Replace all occurrences of a search string with replacement string
  2. Swift String – Replace character in a string

Conversions

  1. Swift – Convert string to integer
  2. Swift – Convert integer to string

Special cases

  1. Swift – Specify floating point precision in string
  2. Swift – Dollar sign in string

Conclusion

In this Swift Tutorial, we learned about Strings, its basics, transformations on Strings, conversions, etc.