[Help] For Each ""

Posts 1–15 of 15 · Page 1 of 1
[Help] For Each ""
Hey i need help replacing all the
Code:
& # 3 3 ;
or ! mark. but in vb it shows it as the code above.

Code:
For each "!" in Line
Blah blah blah?
Code:
HELPPPPPPP!!!!!
Quote Originally Posted by ppl2pass View Post
Hey i need help replacing all the
Code:
& # 3 3 ;
or ! mark. but in vb it shows it as the code above.

Code:
For each "!" in Line
Blah blah blah?
Code:
HELPPPPPPP!!!!!

Hmm... You need to replace items, and declare a string for the 'For' loop that will hold each line you are going through....


Code:
For each x as string in Lines
If x.contains("!") Or x.contains("&") Or x.Contains("#") Or x.Contains("Blah Blah") Then

x=x.replace ("!","")
x=x.replace ("&","")
x=x.replace ("#","")
x=x.replace ("Blah Blah","")

'Display the modified line...
Msgbox (x)


End If

Next
Damnit MJ!! You make me feel like a newb at VB sometimes.. Wait.. Don't answer that..
Sorry it doesnt work.

Code:
   For Each x As String In Topic1Text
            If x.Contains("& #33;") Then
                x = x.Replace("& #33;", "!")
                Label1.Text = Topic1Text
            End If
        Next
I tried this with the:
HELPPPPPPP & #33; & #33; & #33; & #33; & #33;

remove spaces
Just make sure the Spacing is right, remove the spaces in & # 3 3
COnsidering Topic1Text will technically be one string, you should be able to do it this way

[php]
Dim String1 As String = Topic1Text
Dim String2 As String = String1.Replace("& # 3 3;", "")
[/php]


That simple really
Hm. I don't understand this crap o.o
i'mma go re-learn VB >.<
String manipulation is rather simple, the fucntions are pre implimented, it is a matter of figuring out what you are dealing with. In this case, you are dealing with one large string, the mistake is to assume because it has multiple parts it is multiple strings, when in fact it is a single string.

(or so I preserve it to be, waiting for OP to verify)
thanks it worked.

do you know where i can find other codes other than !.

For example ! is & # 3 3 ;

how about @ and $ and %?
Where can i find those?
ok it worked.
Code:
Topic1TextFinal = Topic1Text.Replace("& # 3 3 ;", "!")
What if i wanted to add another line to check for
& # 0 3 6 ;
Are you actually trying to figure out things on your own before asking?
yes i already tried.
You can use another instance of it,

Topic1TextFinal = Topic1Text.Replace("& # 0 3 6 ;", " ")
It should work the same way, just add it after the former.

@ blubb

I believe he tried, there was a decent gap in time , but regardless, I am here to help

nvm it works but i would have alot of strings....
What do you mean a-lot of strings? If you mean in the code, it shouldn't be a big deal, as long as it is functional to the user right?

Code should be kept clean, but sometimes you can't really help it
i hate unclean code o.o
but essentially yes, it doesn't matter as long as it works
Posts 1–15 of 15 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?