Missing function extensions such as .Substring,.IsNullOrEmpty etc

When I type extensions in Studio, my options are very limited. Many are not available such as .Substring, .IsNullOrEmpty etc. Does anyone have any suggestions how to fix?

you can use String.IsNullOrWhiteSpace(“your string”) instead

Hi
SubString and IsNullOrEmpty or methods of String
Type

So if we want to call them either those variables must be of type string or we need to explicitly convert those variables to string type so that we can use these functions

Like this
String.IsNullOrEmpty(variablename.ToString)
And
Variablename.ToString.SubString

Cheers @lhendrix

The issue I am having is that in one process I do not have the .net extensions showing. For instance in one project, I am able to type item.Substring(0,2).ToLower in a For Each loop but in a separate project, I don’t have Substring available after I type “item.”.

Did you specify that item has to be of type string?

Interesting. When I type “item.ToString.”, the option is available. The item is coming from an array of string type. Do you have any idea why in the first project when the array is string type, I don’t have to type “item.ToString.” first but in the second project I do?

Thanks so much for your help!

In FOR EACH loop we got a property called TYPE ARGUMENT
Kindly change its value to String then we will be able to get the string methods with item variable
Cheers @lhendrix

That was it. Thanks so much!

1 Like

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