Switch to full style
ASP/ASP.net examples
Post a reply

search in a string and replace

Thu Mar 31, 2011 12:15 am

Replace a substring .
Code:
<% 
Dim strTest
' original string
strTest= "welcome to codemiles" 
'
print string after replace 
Response
.Write (Replace(strTest, "codemiles", "CM Community")) 
%>
 


here how to find a word in a string
Code:
<% 
Dim strTest
'original string
strTest= "codemiles community member" 
'
search for a word in a string 
strDoSearch
= InStr(strTest, "codemiles") 
print the result of search
Response
.Write strDoSearch
%>
 




Post a reply
  Related Posts  to : search in a string and replace
 String replace by index value     -  
 String replace with Regular Expressions     -  
 search for string in a cell array     -  
 Search in a string using FILTER function     -  
 A simple search page using Google AJAX Search API     -  
 Remove a portion of the array and replace it with something     -  
 Splitting a String Based on a Found String     -  
 check if string ends with specific sub-string in php     -  
 check if string start with a specific sub-string in PHP     -  
 recursive string reversal- reverse string     -  

Topic Tags

ASP Strings