• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

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