I need to split a string depending on a separator I put into a string?
in Javascript the type ‘string’ would have what I need but the Unity3D apparently doesn’t have a ‘string’ but ‘String’ which seems pretty different… I checked online and there are just 2 methods under the class ‘String’…so… anyone can address me to the proper page?
In real javascript it would be Split with small S. The int is the count yes. I can’t find anything about the strings on the Reference Manual Online… and I just want a string split in 2 parts and the separator is ‘+’. I get from unity:
var prms = param.Split(‘+’, 2); //Assets/Login/wwwManager_script.js(164,32): BCE0044: unexpected char: ‘’'.
or
var prms = param.Split(“+”,2);
Assets/Login/wwwManager_script.js(165,31): BCE0023: No appropriate version of ‘String.Split’ for the argument list ‘(String, int)’ was found.
following the go-mono manual there should be any of those options.
the [0] notation on a string returns the char at that location in the string. IIRC, JavaScript has no concept of characters, only strings. And silly me, of course the apostrophe syntax in C# to designate a character doesn’t work in JavaScript because of that (you can use either-or to denote a string) I guess there’s no easy way to define a char, eh? ;_;