Forum

> > CS2D > Scripts > String Equality
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch String Equality

1 Antwort
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt String Equality

Mami Tomoe
User Off Offline

Zitieren
This makes me question life.
Only happens on Linux:

IMG:https://i.imgur.com/UcI7est.png






I solved it, it might be some encoding issue with the save file, unsure because took many random attempts at things to solve this.

Thanks Nighthawk! ^-^

alt Re: String Equality

DC
Admin Off Offline

Zitieren
1
2
3
4
row = {}
row[2] = 'Owner'

print('"Owner"=="' .. row[2] .. '" RETURNS ' .. tostring('Owner' == row[2]))

Works properly on https://www.lua.org/cgi-bin/demo
Also works properly in CS2D when you paste it into sys/server.lua

Only possible conclusion: row[2] does NOT contain the string 'Owner'!
The most common issue in such cases are non-printable white spaces or weird UTF-8 characters. You could check length and letter by letter to identify the issue.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht