Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

String methods

Updated on October 19, 2022

Compare methods

MethodDescription
EqualsDetermines if two string objects have the same value.

Character methods

MethodDescription
IsControlIndicates whether the specified Unicode character is categorized as a control character.
IsDigitIndicates whether a Unicode character is categorized as a decimal digit.
IsLetterIndicates whether a Unicode character is categorized as a Unicode letter.
IsLetterOrDigitIndicates whether a Unicode character is categorized as a letter or a decimal digit.
IsLowerIndicates whether a Unicode character is categorized as a lowercase letter.
IsNumberIndicates whether a Unicode character is categorized as a number.
IsPunctuationIndicates whether a Unicode character is categorized as a punctuation mark.
IsSeparatorIndicates whether a Unicode character is categorized as a separator character.
IsSymbolIndicates whether a Unicode character is categorized as a symbol character.
IsUpperIndicates whether a Unicode character is categorized as an uppercase letter.
IsWhiteSpaceIndicates whether a Unicode character is categorized as white space.

Find methods

MethodDescription
ContainsReturns a value that indicates whether a specified substring occurs within this string.
EndsWithDetermines whether the end of this string instance matches a specified string.
IndexOfReports the zero-based index of the first occurrence of a specified Unicode character or string within this instance. The method returns -1 if the character or string is not found in this instance.
LastIndeOfReports the zero-based index position of the last occurrence of a specified Unicode character or string within this instance. The method returns -1 if the character or string is not found in this instance.
StartsWithDetermines whether the beginning of this string instance matches the specified string.
SubstringRetrieves a substring from a string. The substring starts at a specified character position and has two overloads that offer different options on length.

Format methods

MethodDescription
FormatConverts the value of objects to strings based on the formats specified and inserts them into another string.

Modify methods

MethodDescription
ConcatConcatenates one or more instances of a string, or the string representations of the values of one or more instances of an object.
InsertReturns a new string in which a specified string is inserted at a specified index position in this instance.
JoinConcatenates the elements of a specified array or the members of a collection, using the specified separator between each element or member.
LeftReturns a string that contains a specified number of characters from the left side of a string.
PadLeftReturns a new string of a specified length in which the beginning of the current string is padded with spaces or with a specified Unicode character.
PadRightReturns a new string of a specified length in which the end of the current string is padded with spaces or with a specified Unicode character.
RemoveReturns a new string in which a specified number of characters from the current string are deleted.
ReplaceReturns a new string in which all occurrences of a specified Unicode character or String in the current string are replaced with another specified Unicode character or String.
RightReturns a string that contains a specified number of characters from the right side of a string.
SplitReturns a string array that contains the substrings in this instance that are delimited by elements of a specified string or Unicode character array.
StringReserveReturns a string in which the character order of a specified string is reversed.
ToLowerReturns a copy of the string converted to lowercase.
ToStreamReturns a copy of the string loaded into a stream.
ToTextReaderReturns a copy of the string loaded into a TextReader.
ToUpperReturns a copy of the string converted to uppercase.
TrimReturns a new string in which all leading and trailing occurrences of a set of specified characters from the current string are removed.
ToProperCaseReturns a copy of the string converted to the appropriate case.
RemovePunctuationReturns a copy of the string with all punctuation removed. This can be useful in situations where special characters are not allowed.

Status methods

MethodDescription
IsDBNullOrEmptyIndicates whether the specified string is aDBNull, null, or an empty string.
IsNullOrEmptyIndicates whether the specified string is null or an empty string.
LengthReturns the number of characters in the current string object.

Regex methods

MethodDescription
IsRegexMatchIndicates whether the regular expression finds a match in the input string.
RegexReplaceIn a specified input string, replaces strings that match a regular expression pattern with a specified replacement string.
RegexMatchSearches an input string for a substring that matches a regular expression pattern and returns the first occurrence as a single match object.
RegexMatchesSearches an input string for all occurrences of a regular expression and returns all the matches.
RegexSplitSplits an input string into an array of substrings at the positions defined by a regular expression match.
ExtractGroupExtracts a match group from string and RegEx based on a group index.
ExtractMatchGroupExtracts a match group from a .NET Match object based on a group index.
ExtractMatchGroupsExtracts a GroupCollection from a .NET Match object.
HasEmailAddressValidates if the input string is an email address.
HasUrlValidates if the input string is a URL.
HasIPAddressValidates if the input string is an IP address.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us