String Split Issue


#1

How can I save only the month from the string Tuesday, 11 April 2017 into a variable?

Attached is the XAML file for the same.

Main.xaml (6.5 KB)


#2

Hello @nesachdeva,

In order to get the complete name of the month from any date say “today”, you just need to use today.ToString(“MMMM”) . PFA the sample WF. Main (2).xaml (4.8 KB)


#3

Thanks!
Is there still a way on how to store the a part of the string into a variable?


#4

Yes @nesachdeva, there can be more than one ways. Can you explain your exact requirement so that I can suggest you the best possible way?


#5

@Prakshi_Tyagi Awesome! thanks,

@nesachdeva Hi, you can use the assign activity and put what @Prakshi_Tyagi suggested,

like :slight_smile:

Assign = today.ToString(“MMMM”)


#6

Sure @Prakshi_Tyagi
I have split the string into multiple sub-strings. I am unable to figure out the index of each substring, as I am not getting the desired result.
I am using String TypeArgument and getting an cast error on using the System.String[] TypeArgument.

Please refer to the XAML file for further details.
Main.xaml (6.5 KB)


#7

@nesachdeva, When you split a string, it gives you an array of sub-strings which you can use to retrieve values by using index. i.e. arrName(index). In your case it would be b(0) for Day, b(1) for Date, b(2) for month name and so on. PFA the WF.StringSplitWF.xaml (6.0 KB)

Let me know if it helps!