...

View Full Version : inStr



crmpicco
08-11-2005, 02:02 PM
if inStr(selection,",") <> "0" then
instring = inStr(selection,",")
selection = left(selection, len(selection)-selection-1)
end if

selection's value is 'Denver, CO'

How do i cut it up to be just 'Denver'

crmpicco
08-11-2005, 02:03 PM
if inStr(selection,",") <> "0" then
instring = inStr(selection,",")
length = len(selection)
selection = left(selection, instring-1)
end if

Brandoe85
08-12-2005, 06:13 AM
Why not just use Split() (http://www.w3schools.com/vbscript/func_split.asp)


<%
Dim selection
selection = "Denver, CO"

Response.Write getVal(selection)

Private Function getVal(ByVal str)
Dim arr
arr = Split(str, ",")

getVal = arr(0)
End Function

%>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum