rikki Posted October 27, 2014 Report Posted October 27, 2014 hello, office lo i tried but i didn't get I am checking if a string has a comma in its value string a = "aaa,bbb" how could i check if it has a comma or not i did a.match(/*+[,]+*/) this aint working helpp
VenkatD Posted October 27, 2014 Report Posted October 27, 2014 indexOf ane function leda ?? only comma ite ... indexOf(',') > 0 ani try cheyye
VenkatD Posted October 27, 2014 Report Posted October 27, 2014 String a = "aaa,bbb"; int i = a.indexOf(','); System.out.println("The value of I is -->"+i);
maverick23 Posted October 27, 2014 Report Posted October 27, 2014 String a = "aaa,bbb"; int i = a.indexOf(','); System.out.println("The value of I is -->"+i); bhayya neeku phyton scripting vachaa... bye1
VenkatD Posted October 27, 2014 Report Posted October 27, 2014 bhayya neeku phyton scripting vachaa... bye1 logic rasta .. but syntactical gaa anta knowledge ledu ... what is it u want ??
rikki Posted October 27, 2014 Author Report Posted October 27, 2014 bro if in future instead of comma if there is diff char match is good right? a.match(/[,]/) koosintha work itaandi this one indexOf ane function leda ?? only comma ite ... indexOf(',') > 0 ani try cheyye
VenkatD Posted October 27, 2014 Report Posted October 27, 2014 bro if in future instead of comma if there is diff char match is good right? a.match(/[,]/) koosintha work itaandi this one yea see this one http://www.tutorialspoint.com/javascript/string_match.htm
Walcommon Posted October 27, 2014 Report Posted October 27, 2014 hello, office lo i tried but i didn't get I am checking if a string has a comma in its value string a = "aaa,bbb" how could i check if it has a comma or not i did a.match(/*+[,]+*/) this aint working helpp Is this for grabbing valid email address??
k2s Posted October 27, 2014 Report Posted October 27, 2014 hello, office lo i tried but i didn't get I am checking if a string has a comma in its value string a = "aaa,bbb" how could i check if it has a comma or not i did a.match(/*+[,]+*/) this aint working helpp >>> import re >>> a = 'aaa,bbb' >>> a_regex = re.compile(r'(a{3}),(b{3})') >>> if (re.match(a_regex,a)): print True else: print False True >>>
VenkatD Posted October 27, 2014 Report Posted October 27, 2014 >>> import re >>> a = 'aaa,bbb' >>> a_regex = re.compile(r'(a{3}),(b{3})') >>> if (re.match(a_regex,a)): print True else: print False True >>> Scrooge uncle u python ??
Recommended Posts