remove trailing characters

1. Kentium Guest

## remove trailing characters

Say I have a series of numbers-<BR><BR>0;1;8;9;10;11<BR>or<BR>2;1;7;4;8;9;10;11<B R><BR>And say I&#039;d like to chop off the trailing 8 characters, so in either instance above I am left with-<BR><BR>0;1<BR>or<BR>2;1;7;4<BR><BR>Would I use LEN and RIGHT in conjunction to perform this task?<BR><BR>Thanks!

2. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## TRY it

and let us know if it works.<BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
96,118

## trailing EIGHT characters????

0;1;8;9;10;11 --&#062;&#062; 0;1 ????<BR><BR>2;1;7;4;8;9;10;11 --&#062;&#062; 2;1;7;4 ????<BR><BR>In both those cases, it looks to me like you are dropping *9* characters!<BR><BR>Do you *mean* you want to drop that last FOUR *VALUES*??? That&#039;s a lot different question!<BR><BR>&#060;%<BR>test = "2;1;7;4;8;9;10;11"<BR>temp = Split( test, ";" )<BR>ReDim Preserve temp( UBound(temp)-4 )<BR>newTest = Join( temp, ";" )<BR>%&#062;<BR><BR>Hmnmmm???<BR><BR>

4. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## If it is/was chars

the len and the left functions will do it for him too<BR><BR>

5. Kentium Guest

## Uhhh....

I thought I was counting 8 characters including the semi-colons...but yes you&#039;re correct in assuming that I mean to remove the trailing 4 values.<BR><BR>I don&#039;t wanna re-insert the semi-colon, so I replaced your ";" in the join statement with "" and I get exactly what I wanted.<BR><BR>I was going down the Regular Expression path....thanks for the diversion...that coulda been nasty!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•