Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Removing enterkey char from string

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    Resolved [RESOLVED] [2005] Removing enterkey char from string

    I'm developing a program that has to access and add files and folders from Internet Explorer's favorites folder.The problem is that there's more information in the string that is need, This is the full string

    http://www.microsoft.com/isapi/redir...er=6&ar=CLinks
    Modified=C0224780EF1AC7017A
    [{000214A0-0000-0000-C000-000000000046}]
    Prop3=19,2

    i need to get the link on it's own without the rest of the info

    Here's the code i'm using to try get it but something's wrong

    VB Code:
    1. Dim EnterKey As String = ChrW(Keys.Enter)
    2.                     If String.Compare(fUrl.Substring(0, fUrl.Length), EnterKey) Then
    3.                        
    4.                         i = fUrl.IndexOf(CInt(Val(EnterKey)))
    5.                         If i <> -1 Then
    6.                             fUrl = fUrl.Substring(0, i)
    7.                         End If

    But instead of getting me the link on it's own, it gives me this instead

    http://www.microsoft.com/isapi/redir...er=6&ar=CLinks
    Modified=C

    Can anyone help me?

    Redmo

  2. #2
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: [2005] Removing enterkey char from string

    did you try to do a replace?
    VB Code:
    1. fUrl.Replace(chr(13), String.Empty)
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    Re: [2005] Removing enterkey char from string

    nope, sorry, that doesn't remove anything from the string at all

    here's an image of whats goin on, is there anyway i can reproduce those squares instead of trying to capture the enter char?
    Attached Images Attached Images  

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Removing enterkey char from string

    its likely a chr 10 and 13 (carriage return and line feed)

    try this

    VB Code:
    1. Dim MyString As String = System.Text.RegularExpressions.Regex.Split("URL STRING HERE", Environment.NewLine)(0)

    of course implement a little error handling incase the URL string is not in the expected format.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    Re: [2005] Removing enterkey char from string

    Cool, thanks that worked no problems. it was even silly for me to forget line feed, i was capturing the carraige return, but not the line feed. Thanks for the code m8

    Redmo

Posting Permissions

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



Click Here to Expand Forum to Full Width