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 .
vishal.kp
(vishal)
December 18, 2019, 8:43am
2
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
Palaniyappan:
collection
but i need to convert ienumerable of system.text.regularexpression.match to ienumerable of string object to perform sone string functions on it
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
like
item.ToString so that we can perform the string functions now
Cheers @Abhishek_Aithal1
Palaniyappan:
system.
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
i get below run time error
vickydas
(vicky)
December 19, 2019, 7:20am
12
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
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