Splitting a string

Hi Team,

I need to split a below string, from the below string i need to get the data which is before the letter “l” as we have both caps and small L ,i need to get whatever before l.

example

1)6*200 ml
if it is 1L then i should get as 1L

image quantity
6x200 ml Multipack - Rs 167.09
Combo 3 Items
6x200 ml Multipack - Rs 163.65
180 ml - Rs 18.75
6x200 ml Multipack - Rs 163.65
180 ml - Rs 18.75
3x180 ml Multipack - Rs 64.50
200 ml Can - Rs 30.00
200 ml
6x200 ml Multipack - Rs 210.00
180 ml Mono Carton
200 ml Can
200 g PET
6x180 ml Multipack - Rs 125.04
1 L
1 L
180 ml Mono Carton
200 ml
12 Servings Bottle
1 L

1 Like

Hi @Karthik_Kulkarni

Use row(“quantity”).ToString.replace(“x”,"*")
row(“Quantity”).ToString.trim

Thanks
Ashwin S

Hi @Karthik_Kulkarni

use this as your reference.

cheers :smiley:

Happy learning :smiley:

3 Likes

Hi,

I am unable to split can u explain clearly

1 Like

Have you tried it @Karthik_Kulkarni

cheers :smiley:

Happy learning :smiley:

3 Likes

yeah,

I tried it but am getting a different one
i took as assign activity, where text =6x200 ml Multipack - Rs 167.09
image

1 Like

Hi @Karthik_Kulkarni

Do you like to get the value after the word “l” right ?

cheers :smiley:

Happy learning :smiley:

3 Likes

No @pattyricarte,

Actually i want to get the value present before L , for example

6x200 ml Multipack - Rs 167.09 in this i want as below
6x200 ml.
sometimes we have caps L too so that y i asked .

But anyway now i am not required if you know how to do please let me know i mark for future reference.

Thanks
karthik.

1 Like

Hi @Karthik_Kulkarni
Is that always the format of the string. Because if we are going to get the value before lower case l or upper case L.Its very prone to error.Make sense bacause what if we get alot of multiple character l in the line of the string…I think we need to think more work arround to solve the issues.

I’m happy to help and discuss if can come up with new work arround for these.

cheers :smiley:

Happy learning :smiley:

3 Likes