What are the basic String Operations in C#? Explain.
Some of the basic string operations are:
- Concatenate –Two strings can be concatenated either by using System.String.Concat or by using + operator.
- Modify – Replace(a,b) is used to replace a string with another string. Trim() is used to trim the string at the end or at the beginning.
- Compare – System.StringComparison() is used to compare two strings, either case-sensitive comparison or not case sensitive. Mainly takes two parameters, original string, and string to be compared with.
- Search – StartWith, EndsWith methods are used to search a particular string.
No comments