Finding the first position of specified text
On occasion, you might want to know in what numerical position a word first appears in a string of text. You can use the Formatter by Zapier Text action event with the Find transform function to find the first numerical position of a word or phrase in a string of text. A number will be returned representing the character position of the first letter of the word or phrase. For example, if you wanted to find the position of the word green
in a string of text such as green is a wonderful color
, the returned value would be 0
. If the string of text were isn't green a wonderful color?
, the returned value would be 6
. If the search term does not exist in the string of text, the value that is returned would be -1
. You can also skip several characters that you do not want to be included in the search. For example, if the text string is plum and apple and pear and plum
, we can ignore the first position of the word plum
by skipping the first four...