Hello...

I want to ask how to change text from richtextbox/textbox ?

For example

I have the sentences "The bird fly away"

I want to change it into

Fly bird the away

I tried some code like this

TextBox2.Text = TextBox2.Text.Replace(Fly, The)
TextBox2.Text = TextBox2.Text.Replace(The, Fly)

it become The bird the away
>_<

I also tried to use array but no luck :(

i set the array(0) = T , array(1) = h, array(2) = e
then I set the textbox2.text(0) = array(0) , textbox2.text(1) = array(1) and so on... but cannot.. the syntax got 'blue curly underline'

i hope you understand...

thanks

Recommended Answers

All 2 Replies

since i can't edit anymore i'll just reply to my own thread.. sorry

Or anyone know how to insert text ?
i'll just simple insert "the" before "fly" and then remove "fly"
and then insert "fly" in the beginning and then remove "the"

Dim str = "the bird fly away"
str=str.Replace("fly", "fly1").Replace("the", "fly").Replace("fly1", "the")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.