...
/Working with Text: Advanced String Operations
Working with Text: Advanced String Operations
Learn about joining, formatting, and string manipulation with methods and efficiently build strings using StringBuilder for improved performance.
We'll cover the following...
Let’s see the joining, formatting, and other string members and learn how to build strings efficiently.
Joining, formatting, and other string members
There are many other string
members, as shown in the following table:
Member | Description |
| These methods trim whitespace characters such as space, tab, and carriage return from the beginning and/or end. |
| These convert all the characters into uppercase or lowercase. |
| These methods insert or remove some text. |
| This replaces some text with other text. |
| This can be used instead of allocating memory each time you use a literal string value using an empty pair of double quotes (""). |
| This concatenates two string variables. The + operator does the equivalent when used between string operands. |
| This concatenates one or more string variables with a character in between each one. |
| This checks whether a string variable is null or empty. |
| This checks whether a string variable is null or whitespace; that is, a mix of any number of horizontal and vertical spacing characters, for example, tab, space, carriage return, line feed, and so on. |
| An alternative method to string interpolation for outputting formatted string values, which uses positioned instead of named parameters. |
Note: Some of the preceding methods are
static
methods. This means that the method can only be called from the type, not from a variable ...