String split after colon( : )

Hello
I have a string like this below

Str1= "Name**:**Lenovo
Address:XYZ
Id:123

Now i want to take the value after the colon(:slight_smile: and display in message box

I did it as below

  1. I used split string - as there are new lines
1 Like

Split Each line wrt to β€œ:” and take index(1)

That solves

in property Separator = : give like this
cheers
@Seem

in the split activity , do i need to do this?

or you can use regex


(?<=:).* use this expression!

Yes ,

  1. You can also do with split activity
    2)By using Regex
  2. By Splitting it assign itself

@Pradeep_Shiv

is there a activity by nam - RegEx ??
how to add it, package name

activity = Matches
search in Activity Panel

Check this sample
cheers
@Seem

Main.xaml (4.6 KB)

2 Likes

@Pradeep_Shiv

How did you write the regEx
Can you please hlep me to learn …

1 Like

Hey @Seem,

Have you tried using .Split in an Assign?

Use it like this:

Str_Array = Str1.Split({":"},StringSplitOptions.None)
And then a message box containing Str_Array(1)

image

1 Like

I’ve sent the sample code please check? @Seem

1 Like

@Pradeep_Shiv
Hello Pradeep

i checked it.
The code works…
But i dint get how u wrote the RegEx expresion

Kindly help me out to learn it.

Thank you
Seem

1 Like

Okay ,

Here i found some good links and Info on Regex.

Regards,
Seem

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