Jump to content

Strings VB 6

Miroi Tavares

Recommended Posts

Estás a repetir-te sem responderes a esta parte: "substituira a palavra a ser substituida" pelo quê?


1. Frase 1: "este é o website do portugal a programar"

2. Palavra a substituir: "website"

3. Frase 2: "nova frase que inclui a palavra website para ser substituida"

4. Encontrou a palavra "website"

5. Nova frase 2: "nova frase que inclui a palavra ?????? para ser substituida"

O que é que devia estar no lugar de ?????

Edited by nelsonr
Link to comment
Share on other sites

Private Sub cmdStr_Click()

Dim frase As String

Dim antiga As String, nova As String

Let frase = txtText.Text

Let antiga = txtAntiga.Text

Let nova = txtNova.Text


picShow.Print Left(frase, InStr(frase, antiga) - 1);

picShow.Print nova;

picShow.Print Right(frase, Len(frase) - (InStr(frase, antiga) + Len(antiga) - 1))

End Sub

a consegui substituir uma frase... agora pretendo fazer o seguinte :se por exemplo eu colocar duas palavras identicas como faço para as substituir??

Edited by Miroi Tavares
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.