GetStringLeft(string, int)

Gets a substring from within a string.

string GetStringLeft(
    string sString,
    int nCount
);

Parameters

sString

Target string.

nCount

Length of substring.


Description

Returns a substring containing nCount characters from the left side of sString. Returns an empty string on error.



Remarks

A negative value for nCount is considered invalid and an empty string will be returned.


Version

1.22

Example

void main()
{
    // say "Hello"
    string sMessage = "Hello World!";
    SpeakString(GetStringLeft(sMessage, 5));
}

See Also

functions: GetStringRight | GetSubString
categories: String Functions


 author: Kristian Markon, editor: Daniel Beckman