Jump to content

Recommended Posts

Posted

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 

Posted

indexOf ane function leda ??

 

only comma ite ... indexOf(',') > 0 ani try cheyye

Posted

String a = "aaa,bbb";
        
        int i = a.indexOf(',');
        
        System.out.println("The value of I is -->"+i);

Posted

String a = "aaa,bbb";
        
        int i = a.indexOf(',');
        
        System.out.println("The value of I is -->"+i);

bhayya neeku phyton scripting vachaa... bye1

Posted

bhayya neeku phyton scripting vachaa... bye1

 

logic rasta .. but syntactical gaa anta knowledge ledu ...

 

what is it u want ??

Posted

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

 

Posted

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??

Posted

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
>>> 
Posted

 

>>> 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 ??

×
×
  • Create New...