ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


string

This is an old revision of the document!


String library

ACSUtils provides a rich set of functions for working with strings.

Empty vs invalid strings

ACS strings are actually numbers that identify actual strings in the ACS VM's string table.

A number may not refer to any string at all, in that case it's an invalid string. Unlike some other ACS libraries, ACSUtils doesn't detect and support invalid strings. Passing invalid strings to ACSUtils functions may result in unexpected behavior.

"" is an empty string, i.e. a valid string of length 0. It can be passed to any function and will work as expected.

Comparing strings for equality

Do not use == to check if strings are equal.

Operator == only checks if string numbers are equal. It may mostly work and then stop working randomly, or when used with a string coming from a different ACS library.

To check if strings are equal, you need to compare their contents. ACSUtils provides an easy to use function to check if strings are equal:

bool StrEquals(str a, str b)

And also a case-insensitive version:

bool StrIEquals(str a, str b)

string.1555630831.txt.gz · Last modified: 2019/04/19 02:40 by korshun