SalString
Namespace: PPJ.Runtime
Assembly: PPJ.Runtime.49 (4.9.0.0)
SAL String basic type. It wraps .NET String class. SalString objects are automatically cast to and from .NET String type.
- C#
- VB.NET
public class SalString : IComparable, IConvertible, IFormattable, INullable, ISalType, IXmlSerializable
Public Class SalString
Inherits IComparable
Implements IConvertible, IFormattable, INullable, ISalType, IXmlSerializable
Constructors
SalString()
Constructs a new SalString object containing an empty string.
SalString(x)
Constructs a new SalString object.
| Name | Type | Description |
|---|---|---|
| x | String |
SalString(chars)
Constructs a new SalString object.
| Name | Type | Description |
|---|---|---|
| chars | Char[] |
SalString(chars, index, length)
Constructs a new SalString object.
| Name | Type | Description |
|---|---|---|
| chars | Char[] | |
| index | Int32 | |
| length | Int32 |
SalString(blob)
Constructs a new SalString object.
| Name | Type | Description |
|---|---|---|
| blob | Byte[] |
SalString(blob, index, length)
Constructs a new SalString object.
| Name | Type | Description |
|---|---|---|
| blob | Byte[] | |
| index | Int32 | |
| length | Int32 |
Fields
| Name | Type | Description |
|---|---|---|
| Empty | SalString | empty value |
| Null | SalString | null value |
| NullBlob | SalString | null value for blobs |
Properties
IsBlob
Boolean: Blob flag.
IsEmpty
Boolean: Checks if this SalString object contains a null value or is empty.
IsNull
Boolean: Checks if this SalString object contains a null value.
Item(index)
Char: Character indexer
Length
SalNumber: Returns the string's length up to the terminator char.
Value
String: Returns the inner string value
Methods
Clone()
Returns a copy of this string.
Returns: SalString.
Compare(x, y)
Compares two strings lexicographically to match SAL comparison rules. SAL apparently uses _xcmp().
| Parameter | Type | Description |
|---|---|---|
| x | SalString | |
| y | SalString |
Returns: Int32.
CompareTo(obj)
Compare to an object
| Parameter | Type | Description |
|---|---|---|
| obj | Object |
Returns: Int32.
CompareTo(x)
Compare to a SalString
| Parameter | Type | Description |
|---|---|---|
| x | SalString |
Returns: Int32.
Compress()
Compresses the string.
Returns: SalString.
Compress(sRet)
| Parameter | Type | Description |
|---|---|---|
| sRet | SalString& |
Returns: Boolean.
Concat(x, y)
- operator for concatenating two SalString objects.
| Parameter | Type | Description |
|---|---|---|
| x | SalString | |
| y | SalString |
Returns: SalString.
FirstChar(target, charCode)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& | |
| charCode | SalNumber& |
Returns: Boolean.
FreeHandle(handle)
Frees a string handle created using SalHStringTonumber.
| Parameter | Type | Description |
|---|---|---|
| handle | IntPtr | String handle to release. |
FromHandle(handle, free)
Converts a number (string handle) to a string.
| Parameter | Type | Description |
|---|---|---|
| handle | IntPtr | The handle to convert back to a string. |
| free | Boolean | Indicates that the handle should be released. The default is false. |
Returns: SalString.
FromHandleOnce(handle)
Converts a number (string handle) to a string and releases the handle immediately.
| Parameter | Type | Description |
|---|---|---|
| handle | IntPtr | The handle to convert back to a string. |
Returns: SalString.
FromHex(hex)
Decodes a hexadecimal string into a string.
| Parameter | Type | Description |
|---|---|---|
| hex | String |
Returns: SalString.
GetBlob()
Returns the string content as an array of bytes.
Returns: Byte[].
GetBufferLength()
Returns the current buffer length of the string.
Returns: SalNumber. nLength
IsValidCurrency(precision, scale)
Verifies that an entire character string represents a valid currency value.
| Parameter | Type | Description |
|---|---|---|
| precision | Int32 | |
| scale | Int32 |
Returns: Boolean.
IsValidCurrency(precision, scale, provider)
Verifies that an entire character string represents a valid currency value.
| Parameter | Type | Description |
|---|---|---|
| precision | Int32 | |
| scale | Int32 | |
| provider | IFormatProvider |
Returns: Boolean.
IsValidCurrency(precision, scale, format, provider)
Verifies that an entire character string represents a valid currency value.
| Parameter | Type | Description |
|---|---|---|
| precision | Int32 | |
| scale | Int32 | |
| format | String | |
| provider | IFormatProvider |
Returns: Boolean.
IsValidDateTime()
Verifies that an entire character string represents a valid date/time value.
Returns: Boolean.
IsValidDateTime(provider)
Verifies that an entire character string represents a valid date/time value.
| Parameter | Type | Description |
|---|---|---|
| provider | IFormatProvider |
Returns: Boolean.
IsValidDateTime(format, provider)
Verifies that an entire character string represents a valid date/time value.
| Parameter | Type | Description |
|---|---|---|
| format | String | |
| provider | IFormatProvider |
Returns: Boolean.
IsValidDecimal(precision, scale)
Verifies that an entire character string represents a valid decimal value.
| Parameter | Type | Description |
|---|---|---|
| precision | Int32 | The number of digits to display. |
| scale | Int32 | The number of digits to the right of the decimal point. |
Returns: Boolean. bOk
IsValidDecimal(precision, scale, provider)
Verifies that an entire character string represents a valid decimal value.
| Parameter | Type | Description |
|---|---|---|
| precision | Int32 | The number of digits to display. |
| scale | Int32 | The number of digits to the right of the decimal point. |
| provider | IFormatProvider |
Returns: Boolean. bOk
IsValidDecimal(precision, scale, format, provider)
Verifies that an entire character string represents a valid decimal value.
| Parameter | Type | Description |
|---|---|---|
| precision | Int32 | The number of digits to display. |
| scale | Int32 | The number of digits to the right of the decimal point. |
| format | String | |
| provider | IFormatProvider |
Returns: Boolean. bOk
IsValidIdentifierName()
Returns TRUE if the string is a valid identifier.
Returns: Boolean.
IsValidInteger()
Verifies that an entire character string represents a valid integer value.
Returns: Boolean.
IsValidInteger(format)
Verifies that an entire character string represents a valid integer value.
| Parameter | Type | Description |
|---|---|---|
| format | String |
Returns: Boolean.
IsValidNumber()
Verifies that an entire character string represents a valid number value.
Returns: Boolean. bOk
IsValidNumber(provider)
Verifies that an entire character string represents a valid number value.
| Parameter | Type | Description |
|---|---|---|
| provider | IFormatProvider |
Returns: Boolean.
IsValidNumber(format, provider)
Verifies that an entire character string represents a valid number value.
| Parameter | Type | Description |
|---|---|---|
| format | String | |
| provider | IFormatProvider |
Returns: Boolean.
Left(length)
Returns a substring of a specified length starting at position zero.
| Parameter | Type | Description |
|---|---|---|
| length | Int32 |
Returns: SalString.
Left(length, target)
| Parameter | Type | Description |
|---|---|---|
| length | Int32 | |
| target | SalString& |
Returns: SalNumber.
Lop(target)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& |
Returns: SalNumber.
Mid(pos, length)
Returns a substring, starting at a specified position and containing a specified number of characters.
| Parameter | Type | Description |
|---|---|---|
| pos | Int32 | |
| length | Int32 |
Returns: SalString.
Mid(pos, length, target)
| Parameter | Type | Description |
|---|---|---|
| pos | Int32 | |
| length | Int32 | |
| target | SalString& |
Returns: SalNumber.
Repeat(times)
Concatenates a string with itself a specified number of times.
| Parameter | Type | Description |
|---|---|---|
| times | Int32 |
Returns: SalString.
Repeat(times, target)
| Parameter | Type | Description |
|---|---|---|
| times | Int32 | |
| target | SalString& |
Returns: SalNumber.
Replace(startPos, length, replace)
Replaces characters in one string with characters from another string.
| Parameter | Type | Description |
|---|---|---|
| startPos | Int32 | |
| length | Int32 | |
| replace | String |
Returns: SalString.
Replace(startPos, length, replace, target)
| Parameter | Type | Description |
|---|---|---|
| startPos | Int32 | |
| length | Int32 | |
| replace | String | |
| target | SalString& |
Returns: SalNumber.
Right(length)
Returns a string of specified length, starting with the last character in the string.
| Parameter | Type | Description |
|---|---|---|
| length | Int32 |
Returns: SalString.
Right(length, target)
| Parameter | Type | Description |
|---|---|---|
| length | Int32 | |
| target | SalString& |
Returns: SalNumber.
Scan(pattern)
Searches for and returns the offset of a specified substring. Uses wild card chars: % and _
| Parameter | Type | Description |
|---|---|---|
| pattern | String |
Returns: SalNumber.
SetBufferLength(length)
Sets the buffer string length to the length.
| Parameter | Type | Description |
|---|---|---|
| length | Int32 |
Returns: SalString.
SetBufferLength(target, length)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& | |
| length | Int32 |
Returns: Boolean.
ToDate()
Converts a string to a date/time value.
Returns: SalDateTime.
ToDate(format)
Converts a string to a date/time value.
| Parameter | Type | Description |
|---|---|---|
| format | String |
Returns: SalDateTime.
ToDate(format, provider)
Converts a string to a date/time value.
| Parameter | Type | Description |
|---|---|---|
| format | String | |
| provider | IFormatProvider |
Returns: SalDateTime.
ToHandle()
Converts a string to a number (handle) so it can be passed in a message using SalHStringTonumber. The handle is created using a GCHandle reference to this string. Therefore once the strong reference is created, this string will never be garbage collected until the application exits.
Returns: IntPtr.
ToHex()
Encodes the string buffer to a hexadecimal string.
Returns: String.
Tokenize(startDel, endDel)
Parses a string into substrings (tokens) based on specified start and end delimiters.
| Parameter | Type | Description |
|---|---|---|
| startDel | String | |
| endDel | String |
Returns: SalArray<SalString>.
Tokenize(startDel, endDel, target)
Parses a string into substrings (tokens) based on specified start and end delimiters.
| Parameter | Type | Description |
|---|---|---|
| startDel | String | |
| endDel | String | |
| target | SalArray<SalString> |
Returns: SalNumber.
ToLower()
Converts a string to lowercase.
Returns: SalString.
ToLower(target)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& |
Returns: SalNumber.
ToNumber()
Converts a string to a number.
Returns: SalNumber.
ToNumber(format)
Converts a string to a number.
| Parameter | Type | Description |
|---|---|---|
| format | String |
Returns: SalNumber.
ToNumber(format, provider)
Converts a string to a number.
| Parameter | Type | Description |
|---|---|---|
| format | String | |
| provider | IFormatProvider |
Returns: SalNumber.
ToProper()
Converts a string to a proper name. In a proper name, the first letter of each word is uppercase; the remaining letters are lowercase.
Returns: SalString.
ToProper(target)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& |
Returns: SalNumber.
ToUpper()
Converts a string to uppercase.
Returns: SalString.
ToUpper(target)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& |
Returns: SalNumber.
Trim()
Strips leading and trailing blanks and compresses multiple spaces and tabs within a string to single spaces.
Returns: SalString.
Trim(target)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& |
Returns: SalNumber.
Uncompress()
Decompresses the string.
Returns: SalString.
Uncompress(target)
| Parameter | Type | Description |
|---|---|---|
| target | SalString& |
Returns: Boolean.
Inherited By
| Name | Description |
|---|---|
| SalStringContext | Special SalString extension to support SalContextCurrent(). |
Implements
| Name | Description |
|---|---|
| ISalType | Common base interface for Sal types. |