Extract substring from pos1 up to first occurence of a certain character

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1722

    #1

    Extract substring from pos1 up to first occurence of a certain character

    Hello,
    is it possible to use the function string\substring to extract charaters from a start point up to the frst occurrence of a certain character (an underscore in my case)? I have this situation:

    I have a field old containing strings like this: aaaa_bbbbbbb...._ccc_ddd. I would like to extract the part bbbbb, which has varying length. My formula would look like this:

    Code:
    new = string\substring(old, 6, <and here the first underscore as stop point>);
    In PHP there is explode to realize something like that. Is there a formula, which could achieve this?
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9288

    #2
    Hi. The string\split function can be used https://docs.espocrm.com/administrat...g/#stringsplit.

    Or string\pos https://docs.espocrm.com/administrat...ing/#stringpos in combination with string\substring.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...