Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete all text after "TEXT1" in string?
#1
Hi,

I'm currently using Notepad to search a string of text for a variable of "TEXT1", then deleting everything that is after that variable from the string.

Rather than use notepad, is there a way to do this via QM using replace?

E.g. String = "This is some text. TEXT1 This is some more text."

So in the string above, I would want to delete everything after TEXT1, leaving the string as "This is some text. TEXT1".

Is this possible?
#2
str text= "This is some text. TEXT1 This is some more text."
str lookFor = "TEXT1"
int location = find(text lookFor)
text.remove((location + lookFor.len))
out text


Forum Jump:


Users browsing this thread: 1 Guest(s)