18.12.2018, 06:57
Hey all,
I'm looking for the best way to remove any text in between a { and }, assuming they both exist.
For example
I'm currently using this:
which does the job, but if a player enters a { without closing it, everything after will be ignored.
NOTE: this is just a quick snippit i whipped up.
I was looking as sscanf, but unsure on how to do it. Gave it a good crack tho
Cheers
I'm looking for the best way to remove any text in between a { and }, assuming they both exist.
For example
Код:
STRING: {FFFFFF}My String {00FF00}Here RETURNS: My String Here AND STRING: {FFFFFF} My String { Here Returns: My String { Here
Код:
// REMOVE ANY COLOR CODES!! new bool:open = false; for(new j=0; j<32; j++) { if(inputtext[j] == '{') open = true; if(open == false) { format(str, sizeof(str), "%s%c", str, inputtext[j]); } if(inputtext[j] == '}') open = false; }
NOTE: this is just a quick snippit i whipped up.
I was looking as sscanf, but unsure on how to do it. Gave it a good crack tho
Cheers