Replacing д with ae
#1

Hi, i would like to replace some characters. I know you could use strfind to search for single characters and then replace them. In my example i would like to replace a single character with 2 characters (д with ae, ц with oe ...).
Could someone tell me how to do it?
Reply
#2

Код:
public OnPlayerText(playerid,text[])
{
  new string[45];  

  if(strcmp(text,"//input from player",true)==0)
  {
    SendPlayerMessageToAll(playerid,"//output from player");
    return 0;
  }
  return 1;
}
remove the //
Reply
#3

Thats how id do it without testing or deeper thinking

pawn Код:
new pos = strfind(string, "д", false, 0);
while (pos > -1) {
    string[pos] = 'a';
    strins(string, "e", pos+1);
    pos = strfind(string, "д", false, pos-1);
}
Maybe pos+1 in strins needs to be just pos, the rest should work
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)