29.04.2014, 10:34
How would i get text before and after a character....
For example
How would i get text before and after ',' (comma)
For example
PHP код:
hello,ic3_cr3am
hello,ic3_cr3am
#define Seprate "hello,ic3_cr3am"// storing the variable to seprate
new pos=strfind(Seprate, ",", true);//finding how far comma is from start
new str1[30],str2[30];
strmid(str1,SEPRATE,0,pos);//extracting characters before comma that will be stored in str1
strmid(str2,SEPRATE,pos+1,strlen(SEPRATE));//extracting characters after comma that will be stored in str2
sscanf(text, "p<,>s[16]s[16]", part1, part2)