ID:164658
 
Well, is there a way that I can get rid of a single char from a text string? Like, a-=B? Well, I know that there is procs to do this, just couldnt find one.
The only thing you could do is cut it out with copytext(), as far as I know.
In response to Popisfizzy (#1)
How would I cut it out?
In response to Revojake (#2)
I have a library on my members page with a cuttext function.
I know someone around here has a good text library around here or you can use Spuzz's replace text. The concept is simple. You need to use findtext() and copytext(). Personally, I like the replacetext function better since it can be used for more.

proc/ReplaceText(var/haystack, var/needle, var/replace="")
if(!haystack || !needle) return 0
//check for the two most important variables
var/pos = findtext(haystack, needle)
//get the position of the first needle if any at all
while(pos) //while pos has a true value
haystack = "[copytext(haystack, 1, pos)][replace][copytext(haystack, pos+length(pos))]"
//give haystack a new value of string value before the needle, insert replace value here, string value after the needle
pos = findtext(haystack, needle)
//reset pos for the new iteration of the loop so the value is correct
return haystack
//return the new value of the haystack


In this example, haystack is the entire text string, needle is the string to locate (and remove), and replace is the value to replace the needle with. It's null right now so it simply removes the needle because it replaces it with nothing.
Revojake wrote:
Well, I know that there is procs to do this, just couldnt find one.

I posted one over at [link]