The class Character processes character strings in various ways. Externally all character strings are of the standard string type. In most cases the standard .NET string methods should be used. The methods here are supplied only when exact gmSL compatibility is needed. Within the tool's storage system, all character strings are sequences of 8-bit unsigned bytes – i.e. with values in the range 0-255. Though not required all current implementations of this class use ASCII, UTF-8, or Shift_J variable length encoding.
More...
|
static int | Compare (string string1, string string2, int nCompare=0) |
| The Compare method does a case-insensitive comparison between two character vectors. This is a bounded comparison. The null-character is treated exactly like any other special character. More...
|
|
static int | FindFirst (string source, int length, string substr) |
| The FindFirst method finds the first occurrence of substring in a string starting at the front of the string. All character comparisons are case insensitive. It returns when it finds a first occurrence or when it reaches the end of the string. More...
|
|
static string | HexiDecimal (int iValue, int vbase) |
| The HexiDecimal method converts an integer value into a character string using hexadecimal, decimal, octal, or binary notation. Note that the decimal, octal, and binary notation digits are simply subsets of the hexadecimal digits. More...
|
|
static string | Insert (string source, int iStart, string subStr) |
| The Insert method inserts a substring into a base string starting at a zero-based offset. More...
|
|
static string | Remove (string strValue, int iStart, int length) |
| The Remove method forms a new string by removing a specified number of characters from a string starting at a zero-based offset into the string. More...
|
|
static string | Replace (string source, string oldStr, string newStr) |
| The Replace method forms a new string from an existing one in which all occurrences of a specified substring have been replaced by a new substring. More...
|
|
static string | Substr (string strValue, int iStart, int length) |
| The Substr method forms a new string by extracting a substring from a supplied one. More...
|
|
static string | ToLower (string strValue, int iStart, int length) |
| The ToLower method forces the case of any alphabetic characters contained in a specified string to lower-case. Characters that are not alphabetic or that already have lower-case are not changed. More...
|
|
static string | ToUpper (string strValue, int iStart, int length) |
| The ToUpper method forces the case of any alphabetic characters contained in a specified string to upper-case. Characters that are not alphabetic or that already have upper-case are not changed. More...
|
|
static string | Unpack (string strValue, int iStart) |
| The Unpack method extracts a specified string from a set of strings packed into a single string instance. This method assumes a tool specific internal layout, and has no .NET equivalent. One of the packed string sets used by the tool contains the handler and argument class names for an event. More...
|
|
The class Character processes character strings in various ways. Externally all character strings are of the standard string type. In most cases the standard .NET string methods should be used. The methods here are supplied only when exact gmSL compatibility is needed. Within the tool's storage system, all character strings are sequences of 8-bit unsigned bytes – i.e. with values in the range 0-255. Though not required all current implementations of this class use ASCII, UTF-8, or Shift_J variable length encoding.
◆ Compare()
static int gmslLibrary.Services.Character.Compare |
( |
string |
string1, |
|
|
string |
string2, |
|
|
int |
nCompare = 0 |
|
) |
| |
|
static |
The Compare method does a case-insensitive comparison between two character vectors. This is a bounded comparison. The null-character is treated exactly like any other special character.
- Parameters
-
string1 | contains the first character vector in the comparison. |
string2 | contains the second character vector in the comparison. |
nCompare | specifies the number of characters to be compared. If it is zero then the length of the longest string is used. |
- Returns
- If all characters within the specified range are identical, up to case distinctions, then the method returns a zero. If two characters within the specified range disagree, then the value of the character in the first vector minus that in the second vector is returned.
◆ FindFirst()
static int gmslLibrary.Services.Character.FindFirst |
( |
string |
source, |
|
|
int |
length, |
|
|
string |
substr |
|
) |
| |
|
static |
The FindFirst method finds the first occurrence of substring in a string starting at the front of the string. All character comparisons are case insensitive. It returns when it finds a first occurrence or when it reaches the end of the string.
- Parameters
-
source | contains the string which is being searched. |
length | specifies the length of the search range or zero, which indicates that the entire string is to be searched. |
substr | contains the substring which is being searched for. |
- Returns
- If all characters within the substring are identical to a sequence of characters within the string, up to case distinctions, then the method returns the position, relative to one, of the start of the matching sequence in the string. If no matching sequence can be located in the string, then a zero is returned.
◆ HexiDecimal()
static string gmslLibrary.Services.Character.HexiDecimal |
( |
int |
iValue, |
|
|
int |
vbase |
|
) |
| |
|
static |
The HexiDecimal method converts an integer value into a character string using hexadecimal, decimal, octal, or binary notation. Note that the decimal, octal, and binary notation digits are simply subsets of the hexadecimal digits.
- Parameters
-
iValue | is the integer value to be converted. |
vbase | is the base to be used – 2, 8, 10, or 16. |
- Returns
- The method returns the string containing the character representation.
◆ Insert()
static string gmslLibrary.Services.Character.Insert |
( |
string |
source, |
|
|
int |
iStart, |
|
|
string |
subStr |
|
) |
| |
|
static |
The Insert method inserts a substring into a base string starting at a zero-based offset.
- Parameters
-
source | base string that receives the substring. |
iStart | zero-based offset in the base string where the insertion is to begin. |
subStr | substring being inserted. |
- Returns
- The method returns the result of the insertion.
◆ Remove()
static string gmslLibrary.Services.Character.Remove |
( |
string |
strValue, |
|
|
int |
iStart, |
|
|
int |
length |
|
) |
| |
|
static |
The Remove method forms a new string by removing a specified number of characters from a string starting at a zero-based offset into the string.
- Parameters
-
strValue | contains the string from which characters are to be removed. |
iStart | specifies the zero-based offset of the first character to be removed. |
length | specifies the number of characters to be removed. |
- Returns
- The method returns the newly formed string.
◆ Replace()
static string gmslLibrary.Services.Character.Replace |
( |
string |
source, |
|
|
string |
oldStr, |
|
|
string |
newStr |
|
) |
| |
|
static |
The Replace method forms a new string from an existing one in which all occurrences of a specified substring have been replaced by a new substring.
- Parameters
-
source | contains the original string to be modified. |
oldStr | contains the substring whose occurrences are to be replaced. |
newStr | contains the replacing substring. |
- Returns
- The method returns the new string.
◆ Substr()
static string gmslLibrary.Services.Character.Substr |
( |
string |
strValue, |
|
|
int |
iStart, |
|
|
int |
length |
|
) |
| |
|
static |
The Substr method forms a new string by extracting a substring from a supplied one.
- Parameters
-
strValue | is the supplied source string. |
iStart | is the starting offset in the source string, relative to zero, of the start of the substring. |
length | is the desired length of the substring. If it is negative or zero, then it is added to the length of the source string to determine its final value. |
- Returns
- The method returns the new string.
◆ ToLower()
static string gmslLibrary.Services.Character.ToLower |
( |
string |
strValue, |
|
|
int |
iStart, |
|
|
int |
length |
|
) |
| |
|
static |
The ToLower method forces the case of any alphabetic characters contained in a specified string to lower-case. Characters that are not alphabetic or that already have lower-case are not changed.
- Parameters
-
strValue | is the string containing the value to be converted. |
iStart | is the starting relative to zero of the characters to be converted. |
length | is the number of characters to be considered for conversion. |
- Returns
- The method returns the converted string
◆ ToUpper()
static string gmslLibrary.Services.Character.ToUpper |
( |
string |
strValue, |
|
|
int |
iStart, |
|
|
int |
length |
|
) |
| |
|
static |
The ToUpper method forces the case of any alphabetic characters contained in a specified string to upper-case. Characters that are not alphabetic or that already have upper-case are not changed.
- Parameters
-
strValue | is the string containing the value to be converted. |
iStart | is the starting offset relative to zero of the characters to be converted. |
length | is the number of characters to be considered for conversion. |
- Returns
- The method returns the converted string.
◆ Unpack()
static string gmslLibrary.Services.Character.Unpack |
( |
string |
strValue, |
|
|
int |
iStart |
|
) |
| |
|
static |
The Unpack method extracts a specified string from a set of strings packed into a single string instance. This method assumes a tool specific internal layout, and has no .NET equivalent. One of the packed string sets used by the tool contains the handler and argument class names for an event.
- Parameters
-
strValue | contains the packed set of strings. |
iStart | is the index relative to one of the desired string. |
- Returns
- The method returns the unpacked string.
The documentation for this class was generated from the following file:
- C:/gmProducts/gmStudio_dev/src/gmslAPI/gmslLibrary/Character.cs