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

VS 2008 Str Function

$
0
0
Dim j As Integer
Dim Hold_Number As String
i = 2599
i = i + 1 'at this line, i becomes 2600 as you would expect
Hold_Number = Str(i)
j = Len(Hold_Number)

After the last line executes, j = 5, not 4 as you would expect. It is putting a space character in front of 2600. I guess I can use the trim() to get rid of that space, that that is sloppy coding; I want to know why the Str() function is giving me a blank character at the beginning of my number that I am converting to a string?

adam

Viewing all articles
Browse latest Browse all 27189

Trending Articles



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