To revise string variable (pick sentence ing specific area)

Hello
Here is raw String variable

apple : 11:00am
market
apple : 8:10pm
market
apple : 9:00pm

I want to get last apple . how can I do it?

  1. how to get rid of blanks and changed line.
  2. how can I delete last time?" : 9:00pm"(it can be changed)
  3. how can I delete last “market” and words in front of “market”

Please make assign line for me.
raw string variable’s name is StrVar

Thank you.

Hi

How about the following expression?

System.Text.RegularExpressions.Regex.Match(StrVar,".*(?=\s*:.*?:)",System.Text.RegularExpressions.RegexOptions.RightToLeft).Value

Regards,

Hi @Golf_Aquascape ,

You can use regex expression in order to get the last apple directly without manipulating the string

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.