Split text ,?

Now My code as below.

(item_Process.ToString.ToUpper().Contains(in_config(“FileLeads_Feelook”).ToString)

Now in_config(“FileLeads_Feelook”).ToString = String Fee —> read from excel

But If edit value from Fee —> Fee,Free

Please guide me for edit code.
I want to condition Fee and Free.

Hi @fairymemay ,

Could you give this a try?

image

"Fee,Free".Split({","},StringSplitOptions.RemoveEmptyEntries).First()

image

"Fee,Free".Split({","},StringSplitOptions.RemoveEmptyEntries).Last()

image

"Fee,Free".Split({","},StringSplitOptions.RemoveEmptyEntries).Where(Function(w) w.Equals("Free")).first()

Kind Regards,
Ashwni A.K

HI @fairymemay

Can elaborate little bit?

Based on understanding of your query

Split("fee,Free",",")(0)

image

Regards
Gokul

@ashwin.ashok @Gokul001

It can edit from my code ?

(item_Process.ToString.ToUpper().Contains(in_config(“FileLeads_Feelook”).ToString)

@Gokul001 Now I use file config from read value.

(item_Process.ToString.ToUpper().Contains(in_config(“FileLeads_Feelook”).ToString)

1 Like

Hi @fairymemay ,

Could you give this a try then?

item_Process.ToString.ToUpper().Split({","},StringSplitOptions.RemoveEmptyEntries).Where(Function(w) w.Contains("FREE")).FirstOrDefault().Contains(in_config(“FileLeads_Feelook”).ToString.ToUpper)

Kind Regards,
Ashwin A.K

HI @fairymemay

Try this expression

item_Process.ToString.ToUpper().Split(in_config(“FileLeads_Feelook”).ToString,",")(0)

Regards
Gokul

@Gokul001 It error as below.

@ashwin.ashok I don’t want fix code “Free” in code ?

Hi @fairymemay ,

You can replace that with a variable instead, but you have to let us know where this variable gets its values from.

Kind Regards,
Ashwin A.K

Can you share the variable type for in_config @fairymemay

@Gokul001 Type sting

@ashwin.ashok I don’t understand.

Fine

Try with this expression
With other way around

in_config(“FileLeads_Feelook”).ToString.ToUpper.Contains(item_Process.ToString.ToUpper())

Cheers @fairymemay

@Palaniyappan Now in_config(“FileLeads_Feelook”) = Feelook,Freelook

item_Process.ToString.ToUpper() = C:\Users\212\Downloads\Freelook.xlsx

But output show not found file

How to solve it?

Great

Now I understood the need

Say you have a variable holding the filepath and another variable with two values separated by comma
And if you would like to check whether that two values are there in that filepath or not

Then Mention the expression

item_Process.ToString.ToUpper().Contains(Split(in_config(“FileLeads_Feelook”).ToString.ToUpper, “,”)(0).ToString) OR item_Process.ToString.ToUpper().Contains(Split(in_config(“FileLeads_Feelook”).ToString.ToUpper, “,”)(1).ToString)

Use this in a IF condition like this

Cheers @fairymemay