cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Automation Master
Automation Master

Missing inline function

Jump to solution

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

Labels: (1)
0 Kudos
Reply
4 Replies
Highlighted
Automation Master
Automation Master

Re: Missing inline function

Jump to solution

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

0 Kudos
Reply
Highlighted
Not applicable

Re: Missing inline function

Jump to solution

What about the rest of us on premise clients?

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Missing inline function

Jump 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

[(][\w\s]*[)]

 

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"

View solution in original post

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Missing inline function

Jump to solution

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

0 Kudos
Reply