I’m porting a few Javascripts from an existing project to unity (android build). This code uses the String object class a lot.
Then I realize that while Unity recognizes String as a data Type, most of the String methods are gone.
I need the methods: charAt, split, subString, match, and others, but none are available.
Maybe I just need to import the object class from the android SDK library?. Or use something similar?
I use your first two String functions in an android build with JavaScript.
var sArray = myString.Split("|"[0]);
this line splits a long string separated with a ‘|’. For charAt I just use myString[0] for the first char of myString or myString[1] for the second. This caused an error because I couldn’t do anything with type char, so I changed it back to a 1 char String.