本文整理汇总了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