• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED how to replace clipboard string special chr

FoufaDjo

Member
i want to cope and past only numbs and the chr "." for the ip string but idk a key word to target all special char i only fond string letters and digits that cover specific chr
 

Yal

šŸ§ *penguin noises*
GMC Elder
GML:
function makeIP(str){
var ret = "";
for(var c = 1; c <= string_length(str); c++){
  tis = string_char_at(str,c);
  switch(tis){
    case "0":
    case "1":
    case "2":
    case "3":
    case "4":
    case "5":
    case "6":
    case "7":
    case "8":
    case "9":
    case ".":
      ret += tis;
    break

    default:
      //Do nothing
    }
  }
  return ret;
}
 
Top