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
- Swift – Create a string variable
- Swift – Create an empty string
- Swift – Create multiline string
- Swift – String length
- Swift – Append a string to another string
- Swift – Concatenate strings
- Swift – Compare strings
- Swift – Escape double quotes in string
- Swift – Include variable in string
- Swift – Loop over characters in string
- Swift – Substring
Checks
- Swift – Check if two strings are equal
- Swift – Check if two strings are not equal
- Swift – Check if string is empty
- Swift – Check if string contains substring
- Swift – Check if string starts with a specific prefix
- Swift – Check if string ends with a specific suffix
- Swift – Check if variable type is string
Transformations / Modifications
- Swift – Convert string to lowercase
- Swift – Convert string to uppercase
- Swift – Insert character at specific index in string
- Swift – Remove character at specific index in string
- Swift – Remove last character in string
- Swift – Remove prefix from a string
- Swift – Remove specific character(s) from string
- Swift – Repeat a string for n number of times
- Swift – Reverse string
- Swift – Split string by character
- Swift – Split string by comma
- Swift – Split lines in a string into an array
- Swift – Trim whitespaces from edges of string
Replacements
- Swift String – Replace all occurrences of a search string with replacement string
- Swift String – Replace character in a string
Conversions
Special cases
Conclusion
In this Swift Tutorial, we learned about Strings, its basics, transformations on Strings, conversions, etc.