Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Left and Right vs. Substring() in VB.NET

Tags:

vb.net

Which one would you prefer to extract a sub-string from the given string and why?

I am thinking that since Left and Right are VB functions and not .NET functions, they may cause problems in the future in terms of compatibility.

Please clarify my thoughts on that.

like image 862
Tarik Avatar asked Dec 17 '22 10:12

Tarik


1 Answers

Use whichever makes most sense i.e. makes that piece of code easier to read.

I don't know why you'd think that they'd cause problems in the future, they're functions, they're provided as part of the VB.Net Language set, there is no earthly reason why they would be removed, and even if they were, they would be trivial to re-implement.

Use 'em, cause you ain't gonna lose 'em

like image 123
Binary Worrier Avatar answered Jan 07 '23 03:01

Binary Worrier