This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have been trying to remove everything after first - from the right of a string including the -
Example My string has
Requirement is to always remove everything from the first - right of the string.
I have tried Right([account], FindString([account], '-')) and some regex functions but nothing is giving me the right result.
Let me know if anyone can help.
Go to Solution.
Go to Solution.
I would use Text to Columns and split on "-". You only need to split to two fields and the result you want will be in the first field while everything else will split out into the second field.
Here's a regular expression that should work:
This will output all data before a dash that has only non-dash characters after it.
Additionally, a formula option is below:
This will take the left characters up until a character before the last "-" in the string, thanks to ReverseString.
Here is the sample workflow for your case. Hope this is helpful.
Both the solutions worked in my case.Thank You.
I was probably not reversing the string.
I had laready tried this one.The problem with this one was the split in to first and second was not what I required.
For example -- output was getting split after the first hyphen.
This looks like a good hack for my question. Thanks very much.
@rahulshetty925I see, I missed that important piece. I'm glad you got a solution.
hey can u pls share your solved code ..becoz your .yxmd file is not opening ...share in notepad or readable format