Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27518

VS 2010 String Optimization

$
0
0
Actually writing some VB on this project as been writing C# for a couple years only now.

Soooo this code is using allot of string functions which I think are straight forward to optimize but either need verification or am unsure on some.

Basically all the Microsoft.VisualBasic.Strings functions need to be replaced with the .NET versions should be a safe bet?

Code:

If Right(targetFile, 3) <> "ovl" AndAlso InStr(colName, "PartNumber") = 0 Then

'Should best be written as...

If targetFile.LastIndexOf("ovl") <> targetFile.Length - 3 AndAlso colName.IndexOf("PartNumber") > -1 Then

Code:

If theStr <> "" Then

'Of course should be

If theStr <> String.Empty Then

'Or

If theStr.Trim.Length > 0 Then


Viewing all articles
Browse latest Browse all 27518

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>