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

String parse 2

Status
Not open for further replies.

nastar1

Technical User
Nov 1, 2005
122
US
I have captured the filename from a hyperlink textbox that has a full c: drive path and filename, into another textbox.

This has resulted in a trailing "#" and I'd like to remove it before applying the FileCopy function to it.

I think I know how to capture a string extract using the Right function:
strFileName = Right(txtTaskD.Value, Len(txtTaskD.Value) - InStrRev(txtTaskD.Value, "\"))
, but have not found sample code out here that shows how to strip any of the trailing characters.

I've tried Right(txtIdrv, 1) - 1, but get a type mismatch error.

 
How are ya nastar1 . . .

Have a look at the [blue]HyperLinkPart[/blue] Method!

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
strFileName = left(strFileName,len(strFileName)- numberofcharacterstostrip)

Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
ProgramError,

The Left function did the trick. Thank you.


Aceman, thanks for the hyperlinkpart hint. I may be able to use that in another area.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top