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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shortening a string 1

Status
Not open for further replies.

acl03

MIS
Jun 13, 2005
1,077
US
Is there a function remove the right-most X number of characters?


For example...

Code:
sMyString = "filename.log"
sShortFilename = chopString (sMyString, right, 4)

sShortFilename would now be "filename".


Anything like that exist in VBS?

Thanks,
Andrew

[medal] Hard work often pays off over time, but procrastination pays off right now!
 
sShortFilename = Left(sMyString, Len(sMyString) - 4)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, PHV. That was simple.

Thanks,
Andrew

[medal] Hard work often pays off over time, but procrastination pays off right now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top