Category:String Functions

From NWN Lexicon
Jump to navigationJump to search

String Function Category

Functions that deal with string manipulation.



Functions

Name Brief Description

AdvanceToNextToken

Advance the tokenizer to the next token.

FindSubString

Returns the position of sSubstring in sString.

Get2DAString

Retrieves a string value from a *.2da file on a server.

GetNextToken

Return the next token as determined by AdvanceToNextToken.

GetNumberTokens

Return the number of tokens in the string for the specified delimiter.

GetStringByStrRef

Determines translated string by string reference.

GetStringLeft

Gets a substring from within a string.

GetStringLength

Determines the length of a string.

GetStringLowerCase

Convert a string to lower case.

GetStringRight

Gets a substring from within a string.

GetStringTokenizer

Create and return a string tokenizer for a given string with a specified delimiter.

GetStringUpperCase

Convert string to upper case.

GetSubString

Get a substring from within a string.

GetTokenByPosition

Return the i'th token in the string for the specified delimiter. The first token is at position i=0, the second at i=1, etc.

HasMoreTokens

Check to see if any more tokens remain. Returns FALSE if not, TRUE if so.

InsertString

This function will insert a string into the destination string at the position indicated by nPosition.

PrintString

Records a message to the log file.

SendMessageToAllDMs

Sends a message to all Dungeon Masters on server.

SendMessageToPC

Sends a message to the PC.

SendMessageToPCByStrRef

Send a message to a player

SpeakQuickChat

Sends a line of text overhead the henchman.

StringParse

Given a source string and a delimiter string, this function searches the source string for the delimiter string and returns the portion of the source string that appears either left of the first occurrence of the delimiter, or right of the last occurrence of the delimiter.

StringRemoveParsed

Given a source string, a parse string, and a delimiter string, this function returns the result of removing the leftmost (or rightmost) characters from the source string equaling the length of the parse string to include any trailing (or leading) delimiters found beyond (or before) that point.

StringReplace

Given a source string, search string, and replacement string, this function returns the result of replacing every occurrence of the search string found in the source string with the replacement string.

StringToRGBString

Given a string and an RGB color encoded string, this function returns an equivalent string that will display in the specified color.

TestStringAgainstPattern

Returns whether or not the given text matches the pattern.