tags:

views:

48

answers:

2

i have this line:

Dim strings_extreme = input.Split(","c).Distinct().OrderBy(Function(s) s)

i need to Dim it in one line, and set it a value on another line

how do i do that?

would it just be Dim strings_extreme() ??

and then strings_extreme = input.split.... ?

+5  A: 

Even though VB.net allows you not to specify the type, it's always more safe to specify it explicitly. Hence:

Dim strings_extreme as string()
strings_extreme = input... 
naivists
+1  A: 

Just like this:

Dim strings_extreme
strings_extreme = input.Split(","c).Distinct().OrderBy(Function(s) s)

One note, though. I would turn on option strict. Its never a good idea to declare a variable without a type.

Dim strings_extreme As String()
Gabriel McAdams
Remember to accept this answer if you found it helpful.
Gabriel McAdams