【 解 説 】
何らかの形で、複数行のstringを受け取ることがあります。それを一行ずつに分解して処理するには、System.IO.StringReaderクラスを利用します。
以下のプログラムでは、一行ずつ取り出して、時間的に間隔を置いて、それを一行ずつコンソールに書き出しています。
【 例 文 】
1 2 3 4 5 6 7 8 9 10 11 12 |
Dim strReader As StringReader = New StringReader(multilineText) While True line = strReader.ReadLine() If line IsNot Nothing Then Console.WriteLine(line) Thread.Sleep(100) Else Exit While End If End While |
■お薦め参考関連資料
Microsoft、Visual Studio、Visual Basic、Visual C#、Windows Vista、Windows Server、SQL Server、Visual C++、Visual Web Developerは、米国 Microsoft Corporationの米国及びその他の国における登録商標または商標です。