Skip to main content

Hi,

 

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,

 

Regards,


Christophe

If you are in O365, there are 7 string manipulation actions including Find substring in string.


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.

 

68997_pastedImage_0.png

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...

68998_pastedImage_1.png

The pattern is a series of character matches

p(](ws]*])]

 

I have a starting and closing character match of the parenthesis. I could also escape using (

The w is any word character or oA-Za-z0-9_]

The s is any space type character like tab, line break, or form feed, or o
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"


Hey Christophe, Does this help answer your question, or are you also looking for other alternatives? Great question by the way.


Reply