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

Stripping a string 2

Status
Not open for further replies.

ftpdoo

Programmer
Aug 9, 2001
202
GB
Hi,

I have a string called "strAppPath" which contains the path of the application.

ie "c:\NP1\Script_Loader"

I wish to stip off the word Script_Loader and replace it with "Script_Editor" instead.

Any ideas?
Thankx,
Jonathan
 
Dim strAppPath As String, strChStr As String, strFind As String
strAppPath = "c:\NP1\Script_Loader"
strFind = "Script_Loader"
strChStr = "Script_Editor"
strAppPath = Replace(strAppPath, strFind, strChStr)
MsgBox strAppPath
 
Dim fs, f
Dim strAppPath As String, strChStr As String
Set fs = CreateObject("Scripting.FileSystemObject")
strAppPath = "c:\NP1\Script_Loader"
strChStr = "Script_Editor"
Set f = fs.getfolder(strAppPath)
Set f = f.ParentFolder
Set f = fs.getfolder(f.Path & "\" & strChStr)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top