05-05-2011, 01:35 PM
Hi,
What is the best way of making/using a string as variable length?
I don't know what will be the final size of my target string.
I tried initializing a string s like this,
s = "1234567890"
And then I tried adding extra characters beyond the 10th, e.g., s[11] and s[12]. There was no error, but the extra chars were not saved in the string.
I see there is an insert function. is that the best/only way?
s.insert()
TIA
-avraham
What is the best way of making/using a string as variable length?
I don't know what will be the final size of my target string.
I tried initializing a string s like this,
s = "1234567890"
And then I tried adding extra characters beyond the 10th, e.g., s[11] and s[12]. There was no error, but the extra chars were not saved in the string.
I see there is an insert function. is that the best/only way?
s.insert()
TIA
-avraham