Dec 14th, 2006, 08:08 AM
#1
Thread Starter
Addicted Member
[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:
Dim EnterKey As String = ChrW(Keys.Enter)
If String.Compare(fUrl.Substring(0, fUrl.Length), EnterKey) Then
i = fUrl.IndexOf(CInt(Val(EnterKey)))
If i <> -1 Then
fUrl = fUrl.Substring(0, i)
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
Dec 14th, 2006, 09:19 AM
#2
Re: [2005] Removing enterkey char from string
did you try to do a replace?
VB Code:
fUrl.Replace(chr(13), String.Empty)
Dec 14th, 2006, 09:42 AM
#3
Thread Starter
Addicted Member
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
Dec 14th, 2006, 10:04 AM
#4
Re: [2005] Removing enterkey char from string
its likely a chr 10 and 13 (carriage return and line feed)
try this
VB Code:
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.
Dec 14th, 2006, 11:08 AM
#5
Thread Starter
Addicted Member
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
Forum Rules
Click Here to Expand Forum to Full Width