String = two parts
#1

Hello guys, how can I make this? I want to make this string (it is inputtext) created from two parts of inputtext that mean:

"NAME_LASTNAME" = inputtext, I want to create name lastname array will be 9 and I need so before these two strings will be _ as you see higher. thx
Reply
#2

use sscanf.
pawn Код:
new szFirstName[9], szSecondName[9];
if(!sscanf(inputtext, "p<_>s[9]s[9]", szFirstName, szSecondName)) {
     //names splitted.
}
else {
     //code here..
}
Reply
#3

This isnt working properly, becouse when I type to inputtext this "_text" it says as it is okay name..

I have got this code, but here is problem not like upper one, but when i type for example "text_" it count as correct name

pawn Код:
if(inputtext[0] != '_' && inputtext[strlen(inputtext)] != '_' && (strfind(inputtext, "_", true) != -1))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)