Respond to this messageReturn to Index
Original Message
  • The MID$ statement can only swap strings of same length
    • (Login burger2227)
      R
      Posted Jul 25, 2012 5:33 AM

      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$

    Your Name
    Your Email
    (Optional)
    Message Title
    Message Text
    Options Also send responses to my email address