Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and work.

aviboots(AT)netvision.net.il

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Linux Training
Teach Your Child To Read

BlueHost Web Hosting Black Friday

Bonsai Boy of New York Bonsai Trees and Accessories

DreamCloud The Comfortable Luxury Mattress Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting


Disclosure We are a professional Programming & Software Q&A website, that receives compensation from some of the links whose we show you with Information. It means that my content may contain affiliate links.

16,913 questions

22,602 answers

573 users

How to write number with format string to a text file in VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Using writer As StreamWriter = New StreamWriter("D:\\numbers.txt")
            Dim i As Integer
            For i = 1 To 20 Step 2
                writer.WriteLine("{0:0.0} ", i)
            Next i
        End Using

    End Sub


    ' run:
    ' 
    ' 1.0 
    ' 3.0 
    ' 5.0 
    ' 7.0 
    ' 9.0 
    ' 11.0 
    ' 13.0 
    ' 15.0 
    ' 17.0 
    ' 19.0 

End Module




answered Mar 31, 2015 by avibootz
edited Jun 27, 2015 by avibootz
...