Jump to content

Command to eliminate spaces in names


Recommended Posts

Hi

I don't think there is an dedicated command for this.
but I suggest to loop thru your string and then put it back together.

>strElement< can cut out a part of your string and return it like:
strElement(i, ";", string) or more characters
strElement(i, ".pdf", string)

sInput = " AA 12 B 6 - 0 8 1 5 "
sOutput = ""
sTemp = ""
iTemp = 0

repeat 
	iTemp = iTemp +1
	sTemp = strElement(iTemp, " ",sInput)
	sOutput = text(sOutput, sTemp)
until (sTemp == "") and (iTemp > 1)
Works great, thanks!
and with this code you can replace any character with another
(in this example spaces are replaced by underscores)
sInput = " AA 12 B 6 - 0 8 1 5 "
sOutput = ""
iTemp = 0

repeat
	iTemp = iTemp +1
	sChar = mid(sInput,iTemp,1)
	if sChar == " "
	sOutput = text(sOutput,"_" )
	else
	sOutput = text(sOutput,sChar )
	endif
until (iTemp > len(sInput))
  • 2 weeks later...
  • 2 weeks later...
×
×
  • Create New...