From ZDoom Wiki
Jump to navigation Jump to search

int StrLen (str string)


Returns the length of the string specified by string. Note that all strings in ACS are static, i.e. they are not created on the fly, so it is 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. The existence of StrParam makes this function more useful, however.


  • string: The string whose length we want to know.

Return value

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


This script prints a string and its length:

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

    Print (s:thestring, i:StrLen (thestring));