Here is my code:
var DataStr=w.data;
Data = DataStr.Split(":");
Ter = Data[0];
Owner = Data[1];
It keeps giving me this error:
Help please?
EDIT: I figured it out String.Split has to be lile this: Data = DataStr.Split(":"[0]);
Here is my code:
var DataStr=w.data;
Data = DataStr.Split(":");
Ter = Data[0];
Owner = Data[1];
It keeps giving me this error:
Help please?
EDIT: I figured it out String.Split has to be lile this: Data = DataStr.Split(":"[0]);
(â:â,[0])
var str : String = "tom.mom.mot";
var arr = new Array();
arr = str.Split(".", [0]);
// arr[0] = tom
// arr[1] = mom
Youâre too late!@Tempest
Wow I figured this out right as you guys postedâŚ
great
Itâs probably clearer syntax if you type it like this:
Data = DataStr.Split(â:â);
Split is looking for a char, so use the char quotes.
Creativeâs and Tempestâs sample code is wrong.
You should write â.â[0].
You must not write comma.
Why?whatâs [0]âŚ
it should be
string[] Data = DataStr.Split(':');
The original code (from years ago!) is in Unityscript, so no that wonât work. â:â[0] is correct.
âEric
My bad, i thought that was c#.
Will pay more attention