[Reading Notes] C # advanced programming Chapter 9 string and regular expressions,
(1)System. String class
System. String is a class used to store strings and allow many operations on strings. C # provides the keyword string and related syntax to
From: http://www.cnblogs.com/bignjl/archive/2011/01/14/1935645.html
C # tostring () format string format value: Sometimes, we may need to present the value in a certain format, and we need to format the value. We use a format string to specify the
Tostring
C # tostring () format string format value: Sometimes, we may need to present the value in a certain format, and we need to format the value. We use a format string to specify the format. The format string adopts the following format: axx,
Standard | string standard DateTime format string contains one of the format specifier characters in the following table. If the format specifier is not in the following table, a Run-time exception is thrown. If the format string is longer than a
2013-05-06 08:39:20 | Category: pgsql Develop| report | Font Size Subscribe PostgreSQL 9.3 Introduces a formatted output function that is somewhat similar to the sprintf usage of C. The syntax is as follows: Format (formatstr text [, Formatarg "
The syntax of the format item is {index [, alignment] [: formatstring]}, which specifies the optional length and alignment of the mandatory index and formatted text, and an optional string of the format specifiers. The format specifiers are used to
examples of C # String.Format STRINGSTR1=string. Format ("{0:N1}",56789);//result:56,789.0STRINGSTR2 =string. Format ("{0:N2}",56789);//result:56,789.00STRINGSTR3 =string. Format ("{0:N3}",56789);//result:56,789.000STRINGSTR8 =string. Format ("{0:F1}
The following is an example of formatting the int, float, double, and long types.
//
// Printformat. h// Datatypes////
# Import
@ InterfacePrintformat: nsobject
{
}
-(Void) Print;
@ End
Implementation
//// Printformat.
formatted output for Java
A method to format the output requires a format string and a parameter list (arguments). The format string may include the determined text (fixed text) and one or more format specifiers (formatted specifier). Look at
Examples of C # String.Format
STRINGSTR1 =string. Format ("{0:n1}", 56789); //result:56,789.0
STRINGSTR2 =string. Format ("{0:n2}", 56789); //result:56,789.00
STRINGSTR3 =string. Format ("{0:n3
Tag: operator uppercase bit value print indicates and file is specifiedBitwise operations and filesOne, bit arithmeticThe operand of a bitwise operation can only be integer or character-type dataThe C language provides 6 kinds of bitwise operators:&|
Reprint: http://www.linuxawk.com/jiaocheng/83.html6. printf functionsWhen you print the output, you may need to specify the number of spaces between the fields to arrange the columns neatly. Using tabs in the Print function does not guarantee the
One: Format output function printf ()1, the call form is generally: printf ("Format control string", output table column);2. The format control string is used to specify the output format, which has three forms:
1. Format specifier:
Transformation
1. box, unboxing or alias
Many c#.net books have introduced the int-> Int32 is a boxing process, whereas the reverse is the process of unpacking the box. This is true of many other variable types, such as short int16,long Int64. For
In the project, you may have encountered, you need to convert the decimal to other binary, Google on a search, there are many 2 binary, 8 binary, 16 and decimal conversion method. But in some projects, these may not meet the requirements, may
Second, scanf () function
The scanf () function is a formatted input function that reads the input information from the standard input device (keyboard). The calling format is:
scanf ("", );
The format string consists of the following three
1. binning, unboxing, or Alias
In many C #. NET books, int-> Int32 is a packing process, and vice versa. The same applies to many other variable types, such as short Int16, long Int64. Generally, programmers do not need to understand this process,
C # has been coming out for some days. Recently, due to programming needs, I have made some research on C # type conversion and sorted out a copy of it here to share with you, very useful!
The content involves C # Packing/unpacking/alias, mutual
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.