Link to home
Start Free TrialLog in
Avatar of steva
steva

asked on

Manipulating VB strings in ASPX

Could someone point me to some string manipulation routines in VB? I've picked up a string variable with the following code in Page_Load:

    Public reason As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        reason = Request.Form("Reason")
     End Sub


 The full text for "Reason" , though,  is

                                           DECLINED:1101610001:Invalid account number

and I'd like to modify this to eliminate everything in front of the  ":" and use it in my HTML code with an embedded code block:

                            Transaction <%=reason %>

so the page reads

                          Transaction: invalid account number

Thanks for any ideas.
steva
ASKER CERTIFIED SOLUTION
Avatar of lorelogic
lorelogic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steva
steva

ASKER

Perfect!  

Thanks.
steva
      Dim i As String = "DECLINED:1101610001:Invalid account number"
        Dim pattern As String = ".*:(?<code>.*)"

        Response.Write(Regex.Match(i, pattern).Groups("code").Value)