Different Types of String Operations – Explained
A string is a sequence of characters. Most programming languages provide several operations to work
with strings. The commonly used string operations are:
1. String Creation / Initialization
Creating or declaring a string variable.
2. String Length
Finding the number of characters in a string.
3. String Concatenation
Joining two or more strings together.
4. String Comparison
Comparing two strings to check if they are equal or to determine their lexicographical order.
5. Substring Extraction
Extracting a part of a string.
6. Character Access
Accessing a single character from the string using an index.
7. Searching in a String
Finding the position of a character or substring.
8. String Modification
Operations to convert or replace content such as toUpperCase(), toLowerCase(), trim(), replace().
9. String Splitting
Dividing a string based on a delimiter.
10. String Conversion
Converting other data types to strings.
Summary:
- Creation
- Length
- Concatenation
- Comparison
- Substring
- Character Access
- Searching
- Modification
- Splitting
- Conversion