Split string into multiple strings

Hello,
I am given a string which looks like str = “2020-05-26”
I want to be able to split it into 3 parts like below.

strYear = “2020”
srMonth = “05”
strDay = “26”

How can I do that?

Use Array=Str.Split("-"c)

Array(0)=2020
Array(1)=05
Array(2)=26

Test below as @ImPratham45 said

for month - testsplitstring(1)
for day - testsplitstring(2)

Thanks

1 Like