string resizing
-
Hi all, I want to resize my string, getting rid of the last 5 chars. for example: after I do this:
string a= "example string 4444";
SomeMethod(a);I want 'a' to become "example string" and " 4444" chars will be lost. Is there a built-in function for such thing or should I create a simple algorithm? Thanks...
-
Hi all, I want to resize my string, getting rid of the last 5 chars. for example: after I do this:
string a= "example string 4444";
SomeMethod(a);I want 'a' to become "example string" and " 4444" chars will be lost. Is there a built-in function for such thing or should I create a simple algorithm? Thanks...
-
I knew there was sth like this, I remember it from C times. All I've got to do is to assign the "string size - 5" for starting pos. thanks for reminding :D
-
I knew there was sth like this, I remember it from C times. All I've got to do is to assign the "string size - 5" for starting pos. thanks for reminding :D
Emmet_Brown wrote:
assign the "string size - 5" for starting pos length
FTFY
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.
-
Hi all, I want to resize my string, getting rid of the last 5 chars. for example: after I do this:
string a= "example string 4444";
SomeMethod(a);I want 'a' to become "example string" and " 4444" chars will be lost. Is there a built-in function for such thing or should I create a simple algorithm? Thanks...
string a= "example string 4444";
int numToRemove = 5;a = a.Remove(a.Length - numToRemove - 1, numToRemove);
-
Hi all, I want to resize my string, getting rid of the last 5 chars. for example: after I do this:
string a= "example string 4444";
SomeMethod(a);I want 'a' to become "example string" and " 4444" chars will be lost. Is there a built-in function for such thing or should I create a simple algorithm? Thanks...