Hi, i have a column has this kind of text:
This house is belongs to Andy
This car is belongs to Kelvin
I want the column return me the result of "Andy" & "Kelvin", which means I will only start to take the string after it read "to "
Any idea how to do do it? Thanks!
How to start get strings when end with a string?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Or, slightly more simply
This method relies on the fact that the string returned by the substring operator ends at the end of the source string no matter how many characters were actually requested in the substring operator.
Note also the spaces around the "to". This allows the field to contain something like "This store belongs to Arnold". (There's a "to" in "store".)
Code: Select all
InLink.TheField[Index(InLink.TheField, " to ",1) + 4, 999999]
Note also the spaces around the "to". This allows the field to contain something like "This store belongs to Arnold". (There's a "to" in "store".)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.