本文整理匯總了VB.NET中System.IO.StringReader.ReadLine方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET StringReader.ReadLine方法的具體用法?VB.NET StringReader.ReadLine怎麽用?VB.NET StringReader.ReadLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IO.StringReader
的用法示例。
在下文中一共展示了StringReader.ReadLine方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: StringReader
' From textReaderText, create a continuous paragraph
' with two spaces between each sentence.
Dim aLine, aParagraph As String
Dim strReader As New StringReader(textReaderText)
While True
aLine = strReader.ReadLine()
If aLine Is Nothing Then
aParagraph = aParagraph & vbCrLf
Exit While
Else
aParagraph = aParagraph & aLine & " "
End If
End While
Console.WriteLine("Modified text:" & vbCrLf & vbCrLf & _
aParagraph)
示例2: StringReader.ReadLine()
' 導入命名空間
Imports System
Imports System.IO
Imports System.Text
Public Class MainClass
Shared Sub Main()
' Use a StringWriter to write into a string.
Dim string_writer As New StringWriter()
string_writer.WriteLine("www.java2s.com")
string_writer.WriteLine("www.java2s.com")
' Use a StringReader to read from the string.
Dim string_reader As New StringReader(string_writer.ToString)
string_writer.Close()
Console.WriteLine(string_reader.ReadLine())
Console.WriteLine(string_reader.ReadToEnd())
string_reader.Close()
End Sub
End Class