How to i create a variable of type ienumerable(of string())

I want to convert ienumerable(system.text.regularexpression.match) variable to ienumerable (string()).

I could create variable of ienumerable(string) but not sure how to create ienumerable(string()) varisble cast match object type to string .

I appreciate any detailed help .

string() is nothing but array of string. After ienumurable select array and type as string.

Actually system.text.regularexpression.match is a single value
Only system.text.regularexpression.matchcollection is a collection type of variable

So we can directly iterate through your variable of type Ienumerable(system.text.regularexpression.match) with a FOR EACH ACTIVITY

cheers @Abhishek_Aithal1

1 Like

but i need to convert ienumerable of system.text.regularexpression.match to ienumerable of string object to perform sone string functions on it

This link may help you,

we can perform directly string functions in that variable of type Ienumerable(system.Text.RegularExpressions.Match)

that is if that variable is passed as input to a FOR EACH activity with the type argument chosen as System.Text.RegularExpressions.Match
–and inside the loop use variable with ToString
item.ToString so that we can perform the string functions now

Cheers @Abhishek_Aithal1

i need to perform contains function on this ienumerable .
Since the object type is not string , the function doesnt perform correct .

but with object.ToString.Contains(“yourkeyword”) would work…
inside the loop

Cheers @Abhishek_Aithal1

i need to check the whole ienumerable .
like enum.contains(“string”) would check for this string in all the values present in enum and returns boolian output

@Abhishek_Aithal1 I think we can convert ienumerable(system.text.regularexpression.match) to ienumerable (string()), by using :

IEnumerableStringArrayVar = IEnumerableMatchVar.Cast(Of String())

Is this What you needed :sweat_smile:

i get below run time error :expressionless:

Hello @Abhishek_Aithal1
You can do this simply by using this logic…Assign this to a IEnumerable(of String) datatype variable

ienume_match_Variable.Select(Function(r) Convert.ToString(r) )

To convert this in Arr_of_String just use this code

ienume_match_Variable.Select(Function(r) Convert.ToString(r) ).toarray

@Abhishek_Aithal1 Isn’t the Conversion from IEnumerable.System.Text.RegularExpressions.Match to IEnumerable.System.String?

yes conversion is to string .
coz i want to use contains function on this enumerable variable .

@Abhishek_Aithal1 Can you send me the Workflow, I’ll See if i can Modify it :sweat_smile:

Please how can I delete an empty item while looping through a system.collections.Generic.I enumerable<system.object>

We won’t able to delete while looping buddy
Rather we can delete with an assign
May I know What kind of data is there within the innumerable

Cheers @MasterOfLogic

hi sir how do i use this expression? like saying my output from regex is saved as Title.
so i assign Title= ienume_match_Varaible.Seclect(Function(Title) Convert. ToString(Title) ) ?
sorry i am relatively new to uipath hence not sure how to go about it