Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
80
|
Chapter 2: Strings and Characters
return and line-feed characters to represent a newline; on a Unix system the newline
consists of only the line-feed character
\n. You do not need to worry about this, as
the
AppendLine method knows which newline character(s) to apply.
If you simply want to add several blank lines to your string, you can call
AppendLine
with no parameters. This effectively adds only a newline character to the current string
in the
StringBuilder object on which it was called. Calling this method with no
parameter can also be used to add a newline character(s) to the current line, if the cur-
rent line has no newline character(s). For example, the code in the Solution added a
string with no newline character(s) to the instantiated
StringBuilder object sb. You
can then call sb.AppendLine( ) to force a newline character to be appended to this text.
See Also
See the “StringBuilder.AppendLine Method” topic in the MSDN documentation.
2.26 Encoding Chunks of Data
Problem
You need to encode some data; however, you will be receiving it in blocks of a cer-
tain size, not all at once. Your encoder needs to be able to append each block of data
to the previous one to reconstitute the entire data stream.
Solution
Use the Convert method on the Encoder class. The following method,
ConvertBlocksOfData ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata