Get a specific value from string

Hi All,

I want to take a specific value from the string.

Actual value for the string is “2019-11”, and i need to take only 19 and 11 from it. is there any way to do it.

1 Like

Hi @Manikandasamy

Is that static format ?

cheers :smiley:

Happy learning :smiley:

1 Like

Hi @Manikandasamy

Please see the article below for your reference.

cheers :smiley:
Happy learning :smiley:

1 Like

Nope :frowning:

1 Like

Hi @Manikandasamy
Is that the value that we need to get ? The value before and after of “-” am i correct?

cheers :smiley:

Happy learning :smiley:

1 Like

Partially correct, :stuck_out_tongue:

before “-” i need to take only 19 (from 2019 to 19)

1 Like

ok How about the after how many digit do you need to get @Manikandasamy :smiley:

cheers :smiley:

Happy learning :smiley:

1 Like

@Manikandasamy,

Try this, This will return 2019-11, if you need only 10-11 then use strInput.IndexOf(“-”)-2,4 in the below line of code. Here strinput is the string you have mentioned.

strInput.Substring( strInput.IndexOf("-")-4,7) 
2 Likes

Thanks a lott for your support.

i used the below method to get it.

SUBSTRING
Example 1
Takes content 5 characters from the first character from the left (0)
Variable name = text
Variable type = String
New Variable name = new_text
Variable type = String
text = Hello World Its Me
Assign:
new_text = text.Substring(0, 5)
Write Line:
new_text
Result (Write Line) : Hello
1 Like

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