|
Using the Replace function in ASP
| Language: |
ASP |
Unrated
Rated by 0 Users
1 Star = Horrible 5 Stars = Perfect
Rate Code Now
|
| Posted By: |
blake |
| Author Website: |
Differences between ASP and PHP |
| Posted On: |
7/12/2007 |
| Code Views: |
741 |
This is a simple example showing how to use the Replace function in ASP to replace a certain character, or series of characters, in a string.
|
<% ' initialize the variable dim strSentence
' give the variable a value strSentence = "Hello, Im Blake"
' Oops, we forgot to add the apostrophe in I'm ' Replace function sytax: ' varResult = REPLACE(string_to_search, find, replace) strSentence = replace(strSentence, "Im", "I'm")
' display the new string: ' Hello, I'm Blake response.write(strSentence) %>
View code in Textarea
This code has not been tested by Your WebCode. Use it at your own risk.
Please report any copyright violations.
|
|