How do I use the right function and instr to capture all of the characters to the right of a known charachter.
Posted on 2004-11-17
Good morning experts!
I am trying to capture all of the characters to the right of the colon in a string, using the function below, and I am only getting part of the string. I will include all of the pertinent code.
<%# reqoptions(DataBinder.Eval(Container.DataItem, "requiredoption")& string.empty) %>
above returns from the database "Required_Options:Showerhead,Handshower" WITHOUT the function
returns from the database: "erhead,Handshower" WITH the function
I think i need to set the length? The length to the right of the colon will vary per record.
Protected Function reqoptions(ByVal requiredoption As String) As String
If requiredoption <> "" Then
return Right(requiredoption, InStr(requiredoption, ":"))