Wednesday, June 19, 2019 01:40

Other string methods

There are a number of other string methods that you might find useful. They are:

Compare(), CompareTo()CompareOrdinal() – determines the sort order of strings. It checks if one string is ordered before another when in alphabetical order, whether it is ordered after, or is equivalent. Example:

Equals() – compares strings. It is not the same as the Compare() and CompareTo() functions. Equals tests strings for equality. It is invoked with the function name Equals() or with the equality operator.

IsNullOrEmpty() – indicates whether the specified string is null or an String.Empty string.

IsNullOrWhiteSpace() – indicates whether a specified string is null, empty, or consists only of white-space.

Join() – merges together into a single string the elements of a list or array of strings, using a specified separator.

Clone() – returns a reference to this instance of string.

Insert() – returns a new string in which a specified string is inserted at a specified index

Comments

comments

Tags: , , , , , ,

Leave a Reply