ClrStringHelpers class | QSYS API Reference Guide

Estimated reading time: 9 minutes

This class offers some abstractions for .NET string functions peculiar to the net core platform (and suggested by CA).

Namespace: ASNA.DataGate.Common.Util Assembly: ASNA.QSys.DataGate.Client.dll

Inheritance: Object

Methods

Signature Description
ContainsInvariantIgnoreCase(String, String) Determines whether a string is in the current string, using invariant culture and ignoring case.
ContainsOrdinal(String, Char) Determines whether a character is in the current string, using ordinal comparison.
ContainsOrdinal(String, String) Determines whether a string is in the current string, using ordinal comparison.
ContainsOrdinalIgnoreCase(String, Char) Determines whether a character is in the current string, using ordinal comparison and ignoring case.
ContainsOrdinalIgnoreCase(String, String) Determines whether a string is in the current string, using invariant culture and ignoring case.
GetHashCodeCurrentCultureIgnoreCase(String) Gets the hash code for this string using the current culture and ignoring case.
GetHashCodeInvariantCultureIgnoreCase(String) Gets the hash code for this string using the invariant culture and ignoring case.
GetHashCodeOrdinal(String) Gets the hash code for this string using the specified string comparison.
GetHashCodeOrdinalIgnoreCase(String) Gets the hash code for this string using the specified string comparison, ignoring case.
IndexOfOrdinal(String, Char) Reports the zero-based index of the first occurrence of the specified character in the current string, using ordinal comparison.
ReplaceOrdinal(String, String, String) Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string, using ordinal comparison.
ReplaceOrdinalIgnoreCase(String, String, String) Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string, using ordinal comparison and ignoring case.

bool ContainsInvariantIgnoreCase(string This, string value)

Determines whether a string is in the current string, using invariant culture and ignoring case.

bool ContainsInvariantIgnoreCase(string This, string value)

Parameters

Type Parameter name Description
String This The string to search.
String value The string to seek.

Returns

Type Description
Boolean true if the value parameter occurs within this string, or if value is the empty string (“”); otherwise, false.

bool ContainsOrdinal(string This, char value)

Determines whether a character is in the current string, using ordinal comparison.

bool ContainsOrdinal(string This, char value)

Parameters

Type Parameter name Description
String This The string to search.
Char value The character to seek.

Returns

Type Description
Boolean true if the value parameter occurs within this string, or if value is the empty string (“”); otherwise, false.

bool ContainsOrdinal(string This, string value)

Determines whether a string is in the current string, using ordinal comparison.

bool ContainsOrdinal(string This, string value)

Parameters

Type Parameter name Description
String This The string to search.
String value The string to seek.

Returns

Type Description
Boolean true if the value parameter occurs within this string, or if value is the empty string (“”); otherwise, false.

bool ContainsOrdinalIgnoreCase(string This, char value)

Determines whether a character is in the current string, using ordinal comparison and ignoring case.

bool ContainsOrdinalIgnoreCase(string This, char value)

Parameters

Type Parameter name Description
String This The string to search.
Char value The character to seek.

Returns

Type Description
Boolean true if the value parameter occurs within this string, or if value is the empty string (“”); otherwise, false.

bool ContainsOrdinalIgnoreCase(string This, string value)

Determines whether a string is in the current string, using invariant culture and ignoring case.

bool ContainsOrdinalIgnoreCase(string This, string value)

Parameters

Type Parameter name Description
String This The string to search.
String value The string to seek.

Returns

Type Description
Boolean true if the value parameter occurs within this string, or if value is the empty string (“”); otherwise, false.

int GetHashCodeCurrentCultureIgnoreCase(string This)

Gets the hash code for this string using the current culture and ignoring case.

int GetHashCodeCurrentCultureIgnoreCase(string This)

Parameters

Type Parameter name Description
String This The string for which the hash code is to be obtained.

Returns

Type Description
Int32 The hash code for this string, using the current culture and ignoring case.

int GetHashCodeInvariantCultureIgnoreCase(string This)

Gets the hash code for this string using the invariant culture and ignoring case.

int GetHashCodeInvariantCultureIgnoreCase(string This)

Parameters

Type Parameter name Description
String This The string for which the hash code is to be obtained.

Returns

Type Description
Int32 The hash code for this string, using the invariant culture and ignoring case.

int GetHashCodeOrdinal(string This)

Gets the hash code for this string using the specified string comparison.

int GetHashCodeOrdinal(string This)

Parameters

Type Parameter name Description
String This The string for which the hash code is to be obtained.

Returns

Type Description
Int32 The hash code for this string.

int GetHashCodeOrdinalIgnoreCase(string This)

Gets the hash code for this string using the specified string comparison, ignoring case.

int GetHashCodeOrdinalIgnoreCase(string This)

Parameters

Type Parameter name Description
String This The string for which the hash code is to be obtained.

Returns

Type Description
Int32 The hash code for this string, ignoring case.

int IndexOfOrdinal(string This, char value)

Reports the zero-based index of the first occurrence of the specified character in the current string, using ordinal comparison.

int IndexOfOrdinal(string This, char value)

Parameters

Type Parameter name Description
String This The string to search.
Char value The character to seek.

Returns

Type Description
Int32 The zero-based index position of value if that character is found, or -1 if it is not.

string ReplaceOrdinal(string This, string oldValue, string newValue)

Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string, using ordinal comparison.

string ReplaceOrdinal(string This, string oldValue, string newValue)

Parameters

Type Parameter name Description
String This The string performing the replace operation.
String oldValue The string to be replaced.
String newValue The string to replace all occurrences of oldValue.

Returns

Type Description
String A string that is equivalent to the current string except that all instances of oldValue are replaced with newValue. If oldValue is not found in the current instance, the method returns the current instance unchanged.

string ReplaceOrdinalIgnoreCase(string This, string oldValue, string newValue)

Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string, using ordinal comparison and ignoring case.

string ReplaceOrdinalIgnoreCase(string This, string oldValue, string newValue)

Parameters

Type Parameter name Description
String This The string performing the replace operation.
String oldValue The string to be replaced.
String newValue The string to replace all occurrences of oldValue.

Returns

Type Description
String A string that is equivalent to the current string except that all instances of oldValue are replaced with newValue. If oldValue is not found in the current instance, the method returns the current instance unchanged.