PDA

View Full Version : string manipulation - appending



j0se
November 28th, 2002, 07:21 AM
hello all,

i have a variable (myString) that takes in a string (e.g. "testfile")

and i want to change that string to read: "testfile.txt"

and i don't know where to begin
:(


will this lurning curve ever stop?
please?
=)

pom
November 28th, 2002, 07:35 AM
Well, the + operator is overloaded to work with strings.
So
myString="testfile";
myString+=".txt";
trace (myString);will return testfile.txt

pom :)

j0se
November 28th, 2002, 07:59 AM
god! i really didn't think hard enough about that (i prob wouldn't have solved it, but i should have come close)

cheers!!
:)

PS there's no blushing icon!=)