StringSplitOptions.RemoveEmptyEntries

I am splitting a string on the double quote into an array and want to remove the empty values or elements:

myarry = mystr.split(chr(34),StringSplitOptions.RemoveEmptyEntries)

I am getting the following error in UiPath:

"Error ERROR Validation Error No compiled code to run
error BC30518: Overload resolution failed because no accessible ‘Split’ can be called with these arguments:
‘Public Function Split(separator() As String, options As System.StringSplitOptions) As String()’: Value of type ‘Char’ cannot be converted to ‘1-dimensional array of String’.
‘Public Function Split(separator() As Char, options As System.StringSplitOptions) As String()’: Value of type ‘Char’ cannot be converted to ‘1-dimensional array of Char’.
‘Public Function Split(separator() As Char, count As Integer) As String()’: Value of type ‘Char’ cannot be converted to ‘1-dimensional array of Char’.
‘Public Function Split(ParamArray separator() As Char) As String()’: ‘System.StringSplitOptions’ values cannot be converted to ‘Char’. Use ‘Microsoft.VisualBasic.ChrW’ to interpret a numeric value as a Unicode character or first convert it to ‘String’ to produce a digit. At line 1 Equity Edge Online.xaml

Not sure why?

please check Variable mystr datatype .
It shouldbe string .

@ToddPull
Error comes from that the Signature from the method is different. Give atry on

mystr.split({chr(34). toString},StringSplitOptions.RemoveEmptyEntries)

Take a noticed of {}

2 Likes

@ToddPull, @ppr suggestion should work.

However, such issues are very common hence I come up with following custom activity. You may want to have a look.

Cheers

1 Like

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