Forum

> > CS2D > Scripts > String Equality
Forums overviewCS2D overview Scripts overviewLog in to reply

English String Equality

1 reply
To the start Previous 1 Next To the start

old String Equality

Mami Tomoe
User Off Offline

Quote
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! ^-^

old Re: String Equality

DC
Admin Off Offline

Quote
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview