SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unable to replace " code with another charcter

    Hi All,
    I amdeveloping asp.Net application using VB.net in 2003 version.
    I have written a code is as follows:
    Code:
    If data.IndexOfAny(",".ToCharArray()) > 0 Then
                    tempdata = data.Replace(",", "`^")
                    data = tempdata
                End If
                If data.IndexOfAny("""".ToCharArray()) > 0 Then
                    tempdata = data.Replace("""", "`$*")
                End If
    my data contain
    ""1 of 3" images spec'd for this Photo number Added "A,B,C" to image numbers"
    I want to replace " with `$*. But unable to do that.
    Even If data.IndexOfAny("""".ToCharArray()) > 0 Then the code never enter into this block where data contains ".

    Is there any idea how to replace " codes with `$*.
    Please help me.
    -::Ujjwal::-
    Visit My Site

  2. #2
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.
    I have solved it.
    But any one knows if XML contain & character in data like
    Code:
    <COL>
            <DATA>&quot;1 of 3&quot; & images spec</DATA>
          </COL>
    Now Dim doc As XPathDocument = New XPathDocument(Server.MapPath("~/Uploaded_File/" + sessionData + ".xml"))
    gives exception.

    can anyone help me...
    -::Ujjwal::-
    Visit My Site

  3. #3
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    660
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Put an error handler around the statement and see what you get. Also, find out the value of "sessionData" by debugging, before you pass it to XPathDocument...
    Chuck Norris is so tough,
    mosquitos ask for permission before they bite him


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •