I have a text(ex: "a b cd" or "aa1 b c def") containing feq

I have a text(ex: "a b cd" or "aa1 b c def") containing feq chars/word and spaces. I want to get the substring after last space(in this case: cd or def), without using split function. Since it is going to be part of a doForEach i will not be able to use split function.
Thanks in advance....

OriginalPostID-62321

OriginalPostID-62321

  Discussion posts and replies are publicly visible

Parents
  • doForEach can be used to process rules that have split function. For your use case, you can use the below expression rules -
    A rule to get the last part after the space in your text -
    rule!getLastPart
    - index(split(ri!textValue,char(32)),length(split(ri!textValue,char(32))),"")
    Here, rule input textValue is a single value Text input
    You can now run doforeach on the above -
    doforeach("rule!getLastPart", ri!arrayOfValues)
    Here, arrayOfValues is the array of items that contains many such text as in your example.For each of the text elements, the rule will be executed.
    If you are on version lower than 6.7, you can use doforeach. For 6.7 and above, you can use apply() instead as it is an out of the box function.
Reply
  • doForEach can be used to process rules that have split function. For your use case, you can use the below expression rules -
    A rule to get the last part after the space in your text -
    rule!getLastPart
    - index(split(ri!textValue,char(32)),length(split(ri!textValue,char(32))),"")
    Here, rule input textValue is a single value Text input
    You can now run doforeach on the above -
    doforeach("rule!getLastPart", ri!arrayOfValues)
    Here, arrayOfValues is the array of items that contains many such text as in your example.For each of the text elements, the rule will be executed.
    If you are on version lower than 6.7, you can use doforeach. For 6.7 and above, you can use apply() instead as it is an out of the box function.
Children
No Data