var s:String = "abc-def";
var controlno1:int;
var controlno2:int;
controlno1 = s.substring(0, s.indexOf('-'));
//result = "abc"
controlno2 = s.substring(s.indexOf('-')+1, s.length);
// result = "def"
var controlno1:int;
var controlno2:int;
controlno1 = s.substring(0, s.indexOf('-'));
//result = "abc"
controlno2 = s.substring(s.indexOf('-')+1, s.length);
// result = "def"
s.substring(beginindex,endindex)
Get the substring based on a given string. 0 being the first position.
s.indexOf(string)
Get the position of a character/string on a given string. Result = -1 if the string to find is not found.
RSS Feed 


2 comments:
first time ko dito mare c: maraming matututo dito pero wla akong patience dyan si Pasti lang c:
hehehe programming kc ito eh, taguan ko talaga ng source code
Post a Comment