How Can I Split variable


#1

Hello every community friends, I have a question and I can not solve it by myself.
First, I scraped a variable such as: 26-50/312jian.
But I only want use the 312jian .
How can I split the variable part by part and selet the 312jian which I realy need .
Thank you for your help.
the variable:%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE(4)
this is what I need:%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE(5)

Thank you for your help.


#2

You can use stringvariable.Split("/"c)(1).Trim which will give you the value ‘312jian’


#3

Try this!

StringVariable.Substring(StringVariable.IndexOf("/"))


#4

Hello,

You may find below snapshot useful,

Result

Cheers,
Pankaj


#5

Solve it!!!
Thank your very much :grinning:


#6

Solve it!!!
Thank your very much


#7

Solve it!!!
Thank your very much
you are very kindness and helpful
Hug!!!


#8

emmm…
Another question is: how can I split the “312” only.
:joy::joy::joy:


#9

@Chenzhixing.PRC

To get 3 digit number followed by / in your input try the below expression in Assign activity.

\d{1,3} matches for 1 to 3 digits. you can change if you know number of digits or else use \d+

String_value = system.Text.RegularExpressions.Regex.match("26-50/312jian","(?<=\/)(\d{1,3})").value