The MID$ statement can only swap strings of same length

by (Login burger2227)
R

 

So you have to split up the string into sections:

text$ = "This is my sentence to change."
word1$ = "my"
word2$ = "your"

find = INSTR(text$, word1$)

start$ = LEFT$(text$, find - 1)
ending$ = RIGHT$(text$, LEN(text$) - (find + LEN(word1$) - 1))

PRINT start$ + word2$ + ending$

Posted on Jul 25, 2012, 5:33 AM

Respond to this message   

Return to Index

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement