There are a few inline functions using the position of a character in a string.
I cannot find something like instr (script langage) or find (excel) to help us to find this position.
For example, I am stuck with this: removing everything after a specific character at the end of a string
Removing (My Company) after FirstName LastName
FirstName LastName (My Company) -> FirstName LastName
I need to know where is ( as My Company can be different accross Europe.
I have read the solution to install something on the server but we are not allowed to do it.
Any help appreciate,
Solved! Go to Solution.
You can use a combination of inline functions that together can get what you need. But in this case it would be much easier to use a regular expression action. I'll show an example that I did specific to your case.
In the set variable, I set a single line of text equal to "Lastname Firstname (My Company)"
Then in the Regular Expression action my configuration is as follows...
The pattern is a series of character matches
I have a starting and closing character match of the parenthesis. I could also escape using \(
The \w is any word character or [A-Za-z0-9_]
The \s is any space type character like tab, line break, or form feed, or [ \t\r\n\f]
The CORRECT_ANSWERS get_ent.sh one_id teswt_out is to match zero or more of these between the two character matches of ( and )
I replace the match with nothing then assign the remaining value to a new variable. The new value is "Lastname Firstname"