GetStringLeft(string, int)

From NWN Lexicon

Gets a substring from within a string.

string GetStringLeft(
    string sString,
    int nCount
);

Contents

[edit] Parameters

sString
Target string.
nCount
Length of substring.

[edit] Description

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

[edit] Remarks

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

[edit] Version

1.22

[edit] Example

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

[edit] See Also

functions:  GetSubString, GetStringRight


 author: Kristian Markon, editor: Daniel Beckman

Personal tools
Categories