Strlen

From ZDoom Wiki

Jump to: navigation, search

int StrLen (str string)

Usage

Returns the length of the string specified by string. Note that all strings in ACS are static (ie, they are not created on the fly) so it's not really necessary to use this function unless you have a lot of strings stored in a library somewhere (like in Daedalus) and you need to have proper delays for a HudMessage.

Parameters

  • string
The string whose length we want to know.

Return value

Length (the count of the characters) of the given string.

Examples

This script prints a string and its length:

script 1 (void)
{
    str thestring = "This is the string.";

    Print (s:thestring, i:StrLen (thestring));
}
Personal tools