Ошибка преобразователя частоты

Date: 07/04/2018 | Par: Deltapwwuyq

System.Text namespace. 197 Chapter 10 VB Imports System.Text Friend stringBuffer As New StringBuilder Dim newReceivedData As String 1 Read received data into a String. newReceivedData = myComPort.ReadExisting 1 Append the String to the StringBuilder object. stringBuffer.Append newReceivedData VC# using System.Text; internal StringBuilder stringBuffer = new StringBuilder ; String newReceivedData; // Read received data into a String. newReceivedData = myComPort.ReadExisting ; // Append the String to the StringBuilder object. stringBuffer.Append newReceivedData ; To convert a StringBuilder object to a String, use the ToString property: vb Dim receivedText as String receivedText = stringBuffer.ToString vc# String receivedText; receivedText = stringBuffer.ToString ; To clear a StringBuilder object, use the Remove method: vb stringBuffer.Remove 0, stringBuffer.Length vc# stringBuffer.Remove 0, stringBuffer.Length ; 198 Managing Ports and Transfers in .NET The Remove method can also remove selected characters: vb 1 Remove the first two characters: stringBuffer.Remove 0, 2 vc# // Remove the first two characters: stringBuffer.Remove 0, 2 ; You can specify a capacity when declaring a StringBuilder object: vb Friend stringBuffer As New StringBuilder 1024 vc# internal StringBuilder stringBuffer = new StringBuilder 1024 ; The StringBuilder object can store up to the specified capacity without having to allocate more memory. On exceeding the specified capacity, the object grows in size as needed to hold the data. Using the List Of T Class For storing bytes and other data types as well as strings, the List Of T class the List class in C# offers a solution. The class is in the System.Collections.Generic namespace and supports methods for manipulating, searching, and sorting list elements. The AddRange method can add the contents of an array to the end of a list, expanding the list’s capacity as needed. The RemoveRange method can remove a range of elements from a list. prom-electric.ru

Nouveau commentaire