dotnet / dotnet/vblang

With [shared] Of [params]

Open
#443 8 comments 2 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

With [shared] Of [params]

I suggest to use this form to supply Shared methods with all or some of its params:
```vb.net
With IO.Path Of "C:\1.txt"
Console.WriteLine(.GetDirectory( ))
Console.WriteLine(.GetFileNameWithoutExtension( ))
Console.WriteLine(.GetExtension( ))
End With
```

which can be lowered to:
```vb.net
Console.WriteLine(IO.Path.GetDirectory("C:\1.txt"))
Console.WriteLine(P.GetFileNameWithoutExtension("C:\1.txt"))
Console.WriteLine(P.GetExtension("C:\1.txt"))
```

This can be more compact using #442

```vb.net
With IO.Path Of "C:\1.txt",
Report := Console.WriteLine
Report(.GetDirectory( ))
Report(.GetFileNameWithoutExtension( ))
Report(.GetExtension( ))
End With

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.