Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing characters from string

Status
Not open for further replies.

lunargirrl

Programmer
Jan 26, 2004
77
BR
Hi, I know this may be easy, but I dont find the right way to make that :(

dim str as string
str = myuser001

I'd like to have myuser as result, removing the 3 last characters (the number 001 of my string).
The string size can variate, but always the 3 last charac. should be removed.

TIA!
 
try this
myString = myString.Remove(myString.Length - 3, 3)
hth,
Marty
 
It worked for me - post your code - you are doing something else wrong.

Mark [openup]
 
did you reassign it
just
myString.Remove(myString.Length - 3, 3)
wont do it you have to put it back into a string
myString = myString.Remove(myString.Length - 3, 3)
Marty
 
it worked :) thanka guys for the help!
i forgot to assign it back to the string :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top