Saturday, May 25, 2024 05:51

Table of contents >> Strings And Text Processing > Other string methods

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

Tags: , , , , , ,

Leave a Reply

Follow the white rabbit