rmlynch25
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 11/17/2011
-
Status: offline
|
VBScript Replace Function
Thursday, November 17, 2011 1:25 PM
( permalink)
I'm returning an image filename with full path from a Access DB. I'd like to replace the path (c:\projects\www\Uploads\Image.jpg) with the URL ( www.URL.com/Uploads/Image.jpg) so that the image can be displayed. I'm attempting the following scripting as a test: <%[/style] dim myImage[/style] dim myresult[/style] myresult=(Album.Fields.Item("Filename").Value)[/style] response.write(myresult) & ("<br>")[/style] Replace (Album.Fields.Item("Filename").Value), "Projects", "Test"[/style] response.write(myresult)[/style] response.end[/style] %>[/style] This is my output:[/style] C:\Projects\www\Upload\Image.jpg C:\Projects\www\Upload\Image.jpg[/style] Why is the Replace function not replacing "Projects" with "Test"? [/style] All help is greatly appreciated. [/style]
|
|
|
|
ehvbs
-
Total Posts
:
3321
- Scores: 110
-
Reward points
:
0
- Joined: 6/22/2005
- Location: Germany
-
Status: offline
|
Re:VBScript Replace Function
Saturday, November 19, 2011 4:19 AM
( permalink)
Replace() is a function that returns the modified (copy) of the source string. So you need myresult = Replace(...) to change (the content of) this variable.
|
|
|
|