Hey, how to subtract a piece of text from variable?
I tried but to no avail, help me someone in this thread?Code:self.variable="1234567890"; self.variable-="0";
Hey, how to subtract a piece of text from variable?
I tried but to no avail, help me someone in this thread?Code:self.variable="1234567890"; self.variable-="0";
getsubstr()
substring = getSubStr( string , startIndex , endIndex ); //if endIndex is not set, it may default to string.size
string = "1234567890";
substring = getSubStr( string , 0 , string.size - 1 ); //skip last char '0'
Last edited by serthy; 10th January 2014 at 20:51. Reason: Dang, to slow ._.
kung foo man (11th January 2014),Ni3ls (11th January 2014)
Shouldn't 'string.size - 1' be 'string.size -2'? Because index start at 0 and ends in this case at 9. 'string.size - 1' won't remove any chararacter.
Ok, i am wrong. It will return '12345678'.
Documentation says 'Returns the substring of characters >= <start index> and < <end index>. <end index> is optional';
Last edited by Mitch; 10th January 2014 at 21:39.
Ni3ls (11th January 2014)
Thank you serthy