Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
the rationale that the net framework

The rationale that the net framework

Classes and Objects (with a Short Introduction to Object-Oriented Programming)

To quickly make a StringBuilder with 25,000 copies of the letter A, for example, you would write:

The Length property lets you get or set the current length of the StringBuilder.

If you specify a Length less than the current size, VB truncates the StringBuilder object. If you have created a StringBuilder object with a maximum capacity, then you get an exception if the length you specify is greater than the maximum capacity. (See Chapter 7 for more on exceptions.)
The members of the StringBuilder class that you will use most frequently are very overloaded. They come in so many versions so that you can, for example, add or remove strings, numbers, characters, or an array of characters equally well. For example, the useful Append method adds characters at the end of the StringBuilder:

117

Chapter 4

• Replace(ByVal oldValue As String, ByVal newValue As String): Replaces all instances of the old string with the new one

You can also use:

You call the ToString method to convert a StringBuilder to a String when you do not want to make any more changes to it and only want to look at its parts from that point on.

CAUTION

There is an Equals method in the StringBuilder class, but unlike

StringBuilder objects.

118

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Christina Lang

PageId: DOC3B28904