GetStringLength

From NWN Lexicon



Contents

[edit] GetStringLength(string)

Determines the length of a string.

int GetStringLength(
    string sString
);

[edit] Parameters

sString

Target string to determine length of.


[edit] Description

Returns the length of sString. Returns -1 on error.



[edit] Remarks

This functions is supposed to return -1 on error, but I can't think when you could ever get this function to err. Both of the following scenarios return 0, not -1:

string sBla="";
int nLength=GetStringLength(sBla);

---

string sBla;
int nLength=GetStringLength(sBla);


[edit] Version

1.61

[edit] Example

void main()
{
    string sStr = "Hello World";
    int nLen = GetStringLength(sStr);
    //nLen is now 11
}

[edit] See Also



 author: Daniel Beckman, editor: Lilac Soul
 

Personal tools
Categories