diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 90bb6143e4c6a..27b49d987802f 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -3380,6 +3380,10 @@ "source_path": "docs/standard/about.md", "redirect_url": "/dotnet/standard/index" }, + { + "source_path": "docs/standard/application-essentials.md", + "redirect_url": "/dotnet/standard/index" + }, { "source_path": "docs/standard/assembly-format.md", "redirect_url": "/dotnet/standard/assembly/file-format", @@ -3485,6 +3489,14 @@ "source_path": "docs/standard/base-types/how-to-display-localized-date-and-time-information-to-web-users.md", "redirect_url": "https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/bb882561(v=vs.100)" }, + { + "source_path": "docs/standard/base-types/index.md", + "redirect_url": "/dotnet/standard/base-types/common-type-system" + }, + { + "source_path": "docs/standard/base-types/manipulating-strings.md", + "redirect_url": "/dotnet/standard/base-types/best-practices-strings" + }, { "source_path": "docs/standard/base-types/miscellaneous.md", "redirect_url": "/dotnet/standard/base-types/miscellaneous-constructs-in-regular-expressions" @@ -3501,6 +3513,10 @@ "source_path": "docs/standard/base-types/pad-number.md", "redirect_url": "/dotnet/standard/base-types/how-to-pad-a-number-with-leading-zeros" }, + { + "source_path": "docs/standard/base-types/performing-formatting-operations.md", + "redirect_url": "/dotnet/standard/base-types/how-to-pad-a-number-with-leading-zeros" + }, { "source_path": "docs/standard/base-types/quantifiers.md", "redirect_url": "/dotnet/standard/base-types/quantifiers-in-regular-expressions" @@ -3515,7 +3531,11 @@ }, { "source_path": "docs/standard/base-types/regex-examples.md", - "redirect_url": "/dotnet/standard/base-types/regular-expression-examples" + "redirect_url": "/dotnet/standard/base-types/regular-expression-example-scanning-for-hrefs" + }, + { + "source_path": "docs/standard/base-types/regular-expression-examples.md", + "redirect_url": "/dotnet/standard/base-types/regular-expression-example-scanning-for-hrefs" }, { "source_path": "docs/standard/base-types/roundtrip.md", diff --git a/docs/standard/application-essentials.md b/docs/standard/application-essentials.md deleted file mode 100644 index 120d95d4d063e..0000000000000 --- a/docs/standard/application-essentials.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: ".NET Framework Application Essentials" -ms.date: "03/30/2017" -ms.technology: dotnet-standard -helpviewer_keywords: - - ".NET Framework development" -ms.assetid: 653da4ba-3752-4d1f-a08a-de017dc86ecc ---- -# .NET Framework Application Essentials -This section of the .NET Framework documentation provides information about basic application development tasks in the .NET Framework. - -## In This Section - [Base Types](../../docs/standard/base-types/index.md) - Discusses formatting and parsing base data types and using regular expressions to process text. - - [Collections and Data Structures](../../docs/standard/collections/index.md) - Discusses the various collection types available in the .NET Framework, including stacks, queues, lists, arrays, and structs. - - [Generics](../../docs/standard/generics/index.md) - Describes the Generics feature, including the generic collections, delegates, and interfaces provided by the .NET Framework. Provides links to feature documentation for C#, Visual Basic and Visual C++, and to supporting technologies such as Reflection. - - [Numerics](../../docs/standard/numerics.md) - Describes the numeric types in the .NET Framework. - - [Events](../../docs/standard/events/index.md) - Provides an overview of the event model in the .NET Framework. - - [Exceptions](../../docs/standard/exceptions/index.md) - Describes error handling provided by the .NET Framework and the fundamentals of handling exceptions. - - [File and Stream I/O](../../docs/standard/io/index.md) - Explains how you can perform synchronous and asynchronous file and data stream access and how to use to isolated storage. - - [Dates, Times, and Time Zones](../../docs/standard/datetime/index.md) - Describes how to work with time zones and time zone conversions in time zone-aware applications. - - [Application Domains and Assemblies](../../docs/framework/app-domains/index.md) - Describes how to create and work with assemblies and application domains. - - [Serialization](../../docs/standard/serialization/index.md) - Discusses the process of converting the state of an object into a form that can be persisted or transported. - - [Resources in Desktop Apps](../../docs/framework/resources/index.md) - Describes the .NET Framework support for creating and storing resources. This section also describes support for localized resources and the satellite assembly resource model for packaging and deploying those localized resources. - - [Globalization and Localization](../../docs/standard/globalization-localization/index.md) - Provides information to help you design and develop world-ready applications. - - [Accessibility](../../docs/framework/ui-automation/index.md) - Provides information about Microsoft UI Automation, which is an accessibility framework that addresses the needs of assistive technology products and automated test frameworks by providing programmatic access to information about the user interface (UI). - - [Attributes](../../docs/standard/attributes/index.md) - Describes how you can use attributes to customize metadata. - - [64-bit Applications](../../docs/framework/64-bit-apps.md) - Discusses issues relevant to developing applications that will run on a Windows 64-bit operating system. - -## Related Sections - [Development Guide](../../docs/framework/development-guide.md) - Provides a guide to all key technology areas and tasks for application development, including creating, configuring, debugging, securing, and deploying your application, and information about dynamic programming, interoperability, extensibility, memory management, and threading. - - [Security](../../docs/standard/security/index.md) - Provides information about the classes and services in the common language runtime and the .NET Framework that facilitate secure application development. diff --git a/docs/standard/base-types/basic-string-operations.md b/docs/standard/base-types/basic-string-operations.md index 2092301242eb0..f92ee73b247bc 100644 --- a/docs/standard/base-types/basic-string-operations.md +++ b/docs/standard/base-types/basic-string-operations.md @@ -9,34 +9,16 @@ helpviewer_keywords: ms.assetid: 8133d357-90b5-4b62-9927-43323d99b6b6 ms.custom: seadec18 --- -# Basic String Operations in .NET -Applications often respond to users by constructing messages based on user input. For example, it is not uncommon for Web sites to respond to a newly logged-on user with a specialized greeting that includes the user's name. Several methods in the and classes allow you to dynamically construct custom strings to display in your user interface. These methods also help you perform a number of basic string operations like creating new strings from arrays of bytes, comparing the values of strings, and modifying existing strings. - -## In This Section - [Creating New Strings](../../../docs/standard/base-types/creating-new.md) - Describes basic ways to convert objects into strings and to combine strings. - - [Trimming and Removing Characters](../../../docs/standard/base-types/trimming.md) - Describes how to trim or remove characters in a string. - - [Padding Strings](../../../docs/standard/base-types/padding.md) - Describes how to insert characters or empty spaces into a string. - - [Comparing Strings](../../../docs/standard/base-types/comparing.md) - Describes how to compare the contents of two or more strings. - - [Changing Case](../../../docs/standard/base-types/changing-case.md) - Describes how to change the case of characters within a string. - - [Using the StringBuilder Class](../../../docs/standard/base-types/stringbuilder.md) - Describes how to create and modify dynamic string objects with the class. - - [How to: Perform Basic String Manipulations](../../../docs/standard/base-types/basic-manipulations.md) - Demonstrates the use of basic string operations. - -## Related Sections - [Type Conversion in .NET](../../../docs/standard/base-types/type-conversion.md) - Describes how to convert one type into another type. - - [Formatting Types](../../../docs/standard/base-types/formatting-types.md) - Describes how to format strings using format specifiers. +# Basic string operations in .NET + +Applications often respond to users by constructing messages based on user input. For example, it is not uncommon for websites to respond to a newly logged-on user with a specialized greeting that includes the user's name. + +Several methods in the and classes allow you to dynamically construct custom strings to display in your user interface. These methods also help you perform a number of basic string operations like creating new strings from arrays of bytes, comparing the values of strings, and modifying existing strings. + +## Related sections + +[Type Conversion in .NET](../../../docs/standard/base-types/type-conversion.md)\ +Describes how to convert one type into another type. + +[Formatting Types](../../../docs/standard/base-types/formatting-types.md)\ +Describes how to format strings using format specifiers. diff --git a/docs/standard/base-types/best-practices-strings.md b/docs/standard/base-types/best-practices-strings.md index 337753d146d11..91839ee634103 100644 --- a/docs/standard/base-types/best-practices-strings.md +++ b/docs/standard/base-types/best-practices-strings.md @@ -344,7 +344,3 @@ However, if you replace the , , , , and ) used in application development. - - This topic contains the following sections: - -- [Types in .NET](#types_in_the_net_framework) - -- [Type Definitions](#type_definitions) - -- [Type Members](#type_members) +- Provides a library that contains the primitive data types (such as , , , , and ) used in application development. -- [Characteristics of Type Members](#characteristics_of_type_members) - - -## Types in .NET +## Types in .NET + All types in .NET are either value types or reference types. Value types are data types whose objects are represented by the object's actual value. If an instance of a value type is assigned to a variable, that variable is given a fresh copy of the value. @@ -48,18 +39,18 @@ The common type system defines how types are declared, used, and managed in the The common type system in .NET supports the following five categories of types: -- [Classes](#Classes) +- [Classes](#classes) -- [Structures](#Structures) +- [Structures](#structures) -- [Enumerations](#Enumerations) +- [Enumerations](#enumerations) -- [Interfaces](#Interfaces) +- [Interfaces](#interfaces) -- [Delegates](#Delegates) +- [Delegates](#delegates) - -### Classes +### Classes + A class is a reference type that can be derived directly from another class and that is derived implicitly from . The class defines the operations that an object (which is an instance of the class) can perform (methods, events, or properties) and the data that the object contains (fields). Although a class generally includes both definition and implementation (unlike interfaces, for example, which contain only definition without implementation), it can have one or more members that have no implementation. The following table describes some of the characteristics that a class may have. Each language that supports the runtime provides a way to indicate that a class or class member has one or more of these characteristics. However, individual programming languages that target .NET may not make all these characteristics available. @@ -73,14 +64,14 @@ The common type system defines how types are declared, used, and managed in the |exported or not exported|Indicates whether a class is visible outside the assembly in which it is defined. This characteristic applies only to top-level classes and not to nested classes.| > [!NOTE] -> A class can also be nested in a parent class or structure. Nested classes also have member characteristics. For more information, see [Nested Types](#NestedTypes). +> A class can also be nested in a parent class or structure. Nested classes also have member characteristics. For more information, see [Nested Types](#nested-types). Class members that have no implementation are abstract members. A class that has one or more abstract members is itself abstract; new instances of it cannot be created. Some languages that target the runtime let you mark a class as abstract even if none of its members are abstract. You can use an abstract class when you want to encapsulate a basic set of functionality that derived classes can inherit or override when appropriate. Classes that are not abstract are referred to as concrete classes. A class can implement any number of interfaces, but it can inherit from only one base class in addition to , from which all classes inherit implicitly. All classes must have at least one constructor, which initializes new instances of the class. If you do not explicitly define a constructor, most compilers will automatically provide a parameterless constructor. - -### Structures +### Structures + A structure is a value type that derives implicitly from , which in turn is derived from . A structure is very useful for representing values whose memory requirements are small, and for passing values as by-value parameters to methods that have strongly typed parameters. In .NET, all primitive data types (, , , , , , , , , , , , , and ) are defined as structures. Like classes, structures define both data (the fields of the structure) and the operations that can be performed on that data (the methods of the structure). This means that you can call methods on structures, including the virtual methods defined on the and classes, and any methods defined on the value type itself. In other words, structures can have fields, properties, and events, as well as static and nonstatic methods. You can create instances of structures, pass them as parameters, store them as local variables, or store them in a field of another value type or reference type. Structures can also implement interfaces. @@ -89,9 +80,9 @@ The common type system defines how types are declared, used, and managed in the For each value type, the common language runtime supplies a corresponding boxed type, which is a class that has the same state and behavior as the value type. An instance of a value type is boxed when it is passed to a method that accepts a parameter of type . It is unboxed (that is, converted from an instance of a class back to an instance of a value type) when control returns from a method call that accepts a value type as a by-reference parameter. Some languages require that you use special syntax when the boxed type is required; others automatically use the boxed type when it is needed. When you define a value type, you are defining both the boxed and the unboxed type. - -### Enumerations - An enumeration (enum) is a value type that inherits directly from and that supplies alternate names for the values of an underlying primitive type. An enumeration type has a name, an underlying type that must be one of the built-in signed or unsigned integer types (such as , , or ), and a set of fields. The fields are static literal fields, each of which represents a constant. The same value can be assigned to multiple fields. When this occurs, you must mark one of the values as the primary enumeration value for reflection and string conversion. +### Enumerations + + An enumeration is a value type that inherits directly from and that supplies alternate names for the values of an underlying primitive type. An enumeration type has a name, an underlying type that must be one of the built-in signed or unsigned integer types (such as , , or ), and a set of fields. The fields are static literal fields, each of which represents a constant. The same value can be assigned to multiple fields. When this occurs, you must mark one of the values as the primary enumeration value for reflection and string conversion. You can assign a value of the underlying type to an enumeration and vice versa (no cast is required by the runtime). You can create an instance of an enumeration and call the methods of , as well as any methods defined on the enumeration's underlying type. However, some languages might not let you pass an enumeration as a parameter when an instance of the underlying type is required (or vice versa). @@ -114,9 +105,9 @@ The common type system defines how types are declared, used, and managed in the [!code-csharp[Conceptual.Types.Enum#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.enum/cs/example.cs#1)] [!code-vb[Conceptual.Types.Enum#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.enum/vb/example.vb#1)] - - -### Interfaces + +### Interfaces + An interface defines a contract that specifies a "can do" relationship or a "has a" relationship. Interfaces are often used to implement functionality, such as comparing and sorting (the and interfaces), testing for equality (the interface), or enumerating items in a collection (the and interfaces). Interfaces can have properties, methods, and events, all of which are abstract members; that is, although the interface defines the members and their signatures, it leaves it to the type that implements the interface to define the functionality of each interface member. This means that any class or structure that implements an interface must supply definitions for the abstract members declared in the interface. An interface can require any implementing class or structure to also implement one or more other interfaces. The following restrictions apply to interfaces: @@ -130,9 +121,9 @@ The common type system defines how types are declared, used, and managed in the - Interfaces can define only instance members. They cannot define static members. Each language must provide rules for mapping an implementation to the interface that requires the member, because more than one interface can declare a member with the same signature, and these members can have separate implementations. - - -### Delegates + +### Delegates + Delegates are reference types that serve a purpose similar to that of function pointers in C++. They are used for event handlers and callback functions in .NET. Unlike function pointers, delegates are secure, verifiable, and type safe. A delegate type can represent any instance method or static method that has a compatible signature. A parameter of a delegate is compatible with the corresponding parameter of a method if the type of the delegate parameter is more restrictive than the type of the method parameter, because this guarantees that an argument passed to the delegate can be passed safely to the method. @@ -157,8 +148,8 @@ The common type system defines how types are declared, used, and managed in the > [!NOTE] > It is not necessary to use these methods for event-handler delegates in C#, C++, and Visual Basic, because these languages provide syntax for adding and removing event handlers. - -## Type Definitions +## Type definitions + A type definition includes the following: - Any attributes defined on the type. @@ -178,7 +169,7 @@ The common type system defines how types are declared, used, and managed in the Attributes are themselves classes that inherit from . Languages that support the use of attributes each have their own syntax for applying attributes to a language element. Attributes can be applied to almost any language element; the specific elements to which an attribute can be applied are defined by the that is applied to that attribute class. -### Type Accessibility +### Type accessibility All types have a modifier that governs their accessibility from other types. The following table describes the type accessibilities supported by the runtime. |Accessibility|Description| @@ -211,29 +202,29 @@ The common type system defines how types are declared, used, and managed in the Although a type might reference types from other modules and assemblies, a type must be fully defined within one .NET module. (Depending on compiler support, however, it can be divided into multiple source code files.) Type names need be unique only within a namespace. To fully identify a type, the type name must be qualified by the namespace that contains the implementation of the type. -### Base Types and Interfaces +### Base types and interfaces A type can inherit values and behaviors from another type. The common type system does not allow types to inherit from more than one base type. A type can implement any number of interfaces. To implement an interface, a type must implement all the virtual members of that interface. A virtual method can be implemented by a derived type and can be invoked either statically or dynamically. - -## Type Members +## Type members + The runtime enables you to define members of your type, which specifies the behavior and state of a type. Type members include the following: -- [Fields](#Fields) - -- [Properties](#Properties) +- [Fields](#fields) -- [Methods](#Methods) +- [Properties](#properties) -- [Constructors](#Constructors) +- [Methods](#methods) -- [Events](#Events) +- [Constructors](#constructors) -- [Nested types](#NestedTypes) +- [Events](#events) - -### Fields +- [Nested types](#nested-types) + +### Fields + A field describes and contains part of the type's state. Fields can be of any type supported by the runtime. Most commonly, fields are either `private` or `protected`, so that they are accessible only from within the class or from a derived class. If the value of a field can be modified from outside its type, a property set accessor is typically used. Publicly exposed fields are usually read-only and can be of two types: - Constants, whose value is assigned at design time. These are static members of a class, although they are not defined using the `static` (`Shared` in Visual Basic) keyword. @@ -244,42 +235,42 @@ The common type system defines how types are declared, used, and managed in the [!code-csharp[Conceptual.Types.Members.Fields#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.members.fields/cs/example.cs#1)] [!code-vb[Conceptual.Types.Members.Fields#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.members.fields/vb/example.vb#1)] - - -### Properties + +### Properties + A property names a value or state of the type and defines methods for getting or setting the property's value. Properties can be primitive types, collections of primitive types, user-defined types, or collections of user-defined types. Properties are often used to keep the public interface of a type independent from the type's actual representation. This enables properties to reflect values that are not directly stored in the class (for example, when a property returns a computed value) or to perform validation before values are assigned to private fields. The following example illustrates the latter pattern. [!code-csharp[Conceptual.Types.Members.Properties#1](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.types.members.properties/cs/example.cs#1)] [!code-vb[Conceptual.Types.Members.Properties#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.types.members.properties/vb/example.vb#1)] In addition to including the property itself, the Microsoft intermediate language (MSIL) for a type that contains a readable property includes a `get_`*propertyname* method, and the MSIL for a type that contains a writable property includes a `set_`*propertyname* method. - - -### Methods + +### Methods + A method describes operations that are available on the type. A method's signature specifies the allowable types of all its parameters and of its return value. Although most methods define the precise number of parameters required for method calls, some methods support a variable number of parameters. The final declared parameter of these methods is marked with the attribute. Language compilers typically provide a keyword, such as `params` in C# and `ParamArray` in Visual Basic, that makes explicit use of unnecessary. - - -### Constructors + +### Constructors + A constructor is a special kind of method that creates new instances of a class or structure. Like any other method, a constructor can include parameters; however, constructors have no return value (that is, they return `void`). If the source code for a class does not explicitly define a constructor, the compiler includes a parameterless constructor. However, if the source code for a class defines only parameterized constructors, the Visual Basic and C# compilers do not generate a parameterless constructor. If the source code for a structure defines constructors, they must be parameterized; a structure cannot define a parameterless constructor, and compilers do not generate parameterless constructors for structures or other value types. All value types do have an implicit parameterless constructor. This constructor is implemented by the common language runtime and initializes all fields of the structure to their default values. - - -### Events + +### Events + An event defines an incident that can be responded to, and defines methods for subscribing to, unsubscribing from, and raising the event. Events are often used to inform other types of state changes. For more information, see [Events](../../../docs/standard/events/index.md). - - -### Nested Types + +### Nested types + A nested type is a type that is a member of some other type. Nested types should be tightly coupled to their containing type and must not be useful as a general-purpose type. Nested types are useful when the declaring type uses and creates instances of the nested type, and use of the nested type is not exposed in public members. Nested types are confusing to some developers and should not be publicly visible unless there is a compelling reason for visibility. In a well-designed library, developers should rarely have to use nested types to instantiate objects or declare variables. - -## Characteristics of Type Members +## Characteristics of type members + The common type system allows type members to have a variety of characteristics; however, languages are not required to support all these characteristics. The following table describes member characteristics. |Characteristic|Can apply to|Description| @@ -300,7 +291,7 @@ The common type system defines how types are declared, used, and managed in the > [!NOTE] > The return type is not considered part of a method's signature. That is, methods cannot be overloaded if they differ only by return type. -### Inheriting, Overriding, and Hiding Members +### Inherit, override, and hide members A derived type inherits all members of its base type; that is, these members are defined on, and available to, the derived type. The behavior or qualities of inherited members can be modified in two ways: - A derived type can hide an inherited member by defining a new member with the same signature. This might be done to make a previously public member private or to define new behavior for an inherited method that is marked as `final`. diff --git a/docs/standard/base-types/details-of-regular-expression-behavior.md b/docs/standard/base-types/details-of-regular-expression-behavior.md index 1dd0584d34183..c252439c394b2 100644 --- a/docs/standard/base-types/details-of-regular-expression-behavior.md +++ b/docs/standard/base-types/details-of-regular-expression-behavior.md @@ -145,7 +145,6 @@ The .NET Framework regular expression engine is a backtracking regular expressio |[Thread Safety](../../../docs/standard/base-types/thread-safety-in-regular-expressions.md)|Provides information about regular expression thread safety and explains when you should synchronize access to regular expression objects.| |[.NET Framework Regular Expressions](../../../docs/standard/base-types/regular-expressions.md)|Provides an overview of the programming language aspect of regular expressions.| |[The Regular Expression Object Model](../../../docs/standard/base-types/the-regular-expression-object-model.md)|Provides information and code examples illustrating how to use the regular expression classes.| -|[Regular Expression Examples](../../../docs/standard/base-types/regular-expression-examples.md)|Contains code examples that illustrate the use of regular expressions in common applications.| |[Regular Expression Language - Quick Reference](../../../docs/standard/base-types/regular-expression-language-quick-reference.md)|Provides information about the set of characters, operators, and constructs that you can use to define regular expressions.| ## Reference diff --git a/docs/standard/base-types/formatting-types.md b/docs/standard/base-types/formatting-types.md index a9b948608b65b..4618cae2e4060 100644 --- a/docs/standard/base-types/formatting-types.md +++ b/docs/standard/base-types/formatting-types.md @@ -34,7 +34,7 @@ Formatting is the process of converting an instance of a class, structure, or en - Sometimes the conversion of an object to its string representation is not intuitive. For example, it is not clear how the string representation of a Temperature object or a Person object should appear. For an example that formats a Temperature object in a variety of ways, see the [Standard Format Strings](#standard-format-strings) section. -- Values often require culture-sensitive formatting. For example, in an application that uses numbers to reflect monetary values, numeric strings should include the current culture’s currency symbol, group separator (which, in most cultures, is the thousands separator), and decimal symbol. For an example, see the [Culture-sensitive formatting with format providers](#culture-sensitive-formatting-with-format-providers) section. +- Values often require culture-sensitive formatting. For example, in an application that uses numbers to reflect monetary values, numeric strings should include the current culture's currency symbol, group separator (which, in most cultures, is the thousands separator), and decimal symbol. For an example, see the [Culture-sensitive formatting with format providers](#culture-sensitive-formatting-with-format-providers) section. - An application may have to display the same value in different ways. For example, an application may represent an enumeration member by displaying a string representation of its name or by displaying its underlying value. For an example that formats a member of the enumeration in different ways, see the [Standard Format Strings](#standard-format-strings) section. @@ -47,9 +47,9 @@ Formatting is the process of converting an instance of a class, structure, or en The basic mechanism for formatting is the default implementation of the method, which is discussed in the [Default Formatting Using the ToString Method](#default-formatting-using-the-tostring-method) section later in this topic. However, .NET provides several ways to modify and extend its default formatting support. These include the following: -- Overriding the method to define a custom string representation of an object’s value. For more information, see the [Override the ToString Method](#override-the-tostring-method) section later in this topic. +- Overriding the method to define a custom string representation of an object's value. For more information, see the [Override the ToString Method](#override-the-tostring-method) section later in this topic. -- Defining format specifiers that enable the string representation of an object’s value to take multiple forms. For example, the "X" format specifier in the following statement converts an integer to the string representation of a hexadecimal value. +- Defining format specifiers that enable the string representation of an object's value to take multiple forms. For example, the "X" format specifier in the following statement converts an integer to the string representation of a hexadecimal value. [!code-csharp[Conceptual.Formatting.Overview#3](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/specifier1.cs#3)] [!code-vb[Conceptual.Formatting.Overview#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/specifier1.vb#3)] @@ -88,12 +88,12 @@ Because all types other than interfaces are derived from , t ## Override the ToString method -Displaying the name of a type is often of limited use and does not allow consumers of your types to differentiate one instance from another. However, you can override the `ToString` method to provide a more useful representation of an object’s value. The following example defines a `Temperature` object and overrides its `ToString` method to display the temperature in degrees Celsius. +Displaying the name of a type is often of limited use and does not allow consumers of your types to differentiate one instance from another. However, you can override the `ToString` method to provide a more useful representation of an object's value. The following example defines a `Temperature` object and overrides its `ToString` method to display the temperature in degrees Celsius. [!code-csharp[Conceptual.Formatting.Overview#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/overrides1.cs#2)] [!code-vb[Conceptual.Formatting.Overview#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/overrides1.vb#2)] -In .NET, the `ToString` method of each primitive value type has been overridden to display the object’s value instead of its name. The following table shows the override for each primitive type. Note that most of the overridden methods call another overload of the `ToString` method and pass it the "G" format specifier, which defines the general format for its type, and an object that represents the current culture. +In .NET, the `ToString` method of each primitive value type has been overridden to display the object's value instead of its name. The following table shows the override for each primitive type. Note that most of the overridden methods call another overload of the `ToString` method and pass it the "G" format specifier, which defines the general format for its type, and an object that represents the current culture. |Type|ToString override| |----------|-----------------------| @@ -126,16 +126,16 @@ A standard format string contains a single format specifier, which is an alphabe .NET defines a set of standard format specifiers for all numeric types, all date and time types, and all enumeration types. For example, each of these categories supports a "G" standard format specifier, which defines a general string representation of a value of that type. -Standard format strings for enumeration types directly control the string representation of a value. The format strings passed to an enumeration value’s `ToString` method determine whether the value is displayed using its string name (the "G" and "F" format specifiers), its underlying integral value (the "D" format specifier), or its hexadecimal value (the "X" format specifier). The following example illustrates the use of standard format strings to format a enumeration value. +Standard format strings for enumeration types directly control the string representation of a value. The format strings passed to an enumeration value's `ToString` method determine whether the value is displayed using its string name (the "G" and "F" format specifiers), its underlying integral value (the "D" format specifier), or its hexadecimal value (the "X" format specifier). The following example illustrates the use of standard format strings to format a enumeration value. [!code-csharp[Conceptual.Formatting.Overview#4](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/standard1.cs#4)] [!code-vb[Conceptual.Formatting.Overview#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/standard1.vb#4)] For information about enumeration format strings, see [Enumeration Format Strings](../../../docs/standard/base-types/enumeration-format-strings.md). -Standard format strings for numeric types usually define a result string whose precise appearance is controlled by one or more property values. For example, the "C" format specifier formats a number as a currency value. When you call the `ToString` method with the "C" format specifier as the only parameter, the following property values from the current culture’s object are used to define the string representation of the numeric value: +Standard format strings for numeric types usually define a result string whose precise appearance is controlled by one or more property values. For example, the "C" format specifier formats a number as a currency value. When you call the `ToString` method with the "C" format specifier as the only parameter, the following property values from the current culture's object are used to define the string representation of the numeric value: -- The property, which specifies the current culture’s currency symbol. +- The property, which specifies the current culture's currency symbol. - The or property, which returns an integer that determines the following: @@ -162,14 +162,14 @@ In addition, numeric format strings may include a precision specifier. The meani For more information about standard numeric formatting strings, see [Standard Numeric Format Strings](../../../docs/standard/base-types/standard-numeric-format-strings.md). -Standard format strings for date and time values are aliases for custom format strings stored by a particular property. For example, calling the `ToString` method of a date and time value with the "D" format specifier displays the date and time by using the custom format string stored in the current culture’s property. (For more information about custom format strings, see the [next section](#custom-format-strings).) The following example illustrates this relationship. +Standard format strings for date and time values are aliases for custom format strings stored by a particular property. For example, calling the `ToString` method of a date and time value with the "D" format specifier displays the date and time by using the custom format string stored in the current culture's property. (For more information about custom format strings, see the [next section](#custom-format-strings).) The following example illustrates this relationship. [!code-csharp[Conceptual.Formatting.Overview#5](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.formatting.overview/cs/alias1.cs#5)] [!code-vb[Conceptual.Formatting.Overview#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.formatting.overview/vb/alias1.vb#5)] For more information about standard date and time format strings, see [Standard Date and Time Format Strings](../../../docs/standard/base-types/standard-date-and-time-format-strings.md). -You can also use standard format strings to define the string representation of an application-defined object that is produced by the object’s `ToString(String)` method. You can define the specific standard format specifiers that your object supports, and you can determine whether they are case-sensitive or case-insensitive. Your implementation of the `ToString(String)` method should support the following: +You can also use standard format strings to define the string representation of an application-defined object that is produced by the object's `ToString(String)` method. You can define the specific standard format specifiers that your object supports, and you can determine whether they are case-sensitive or case-insensitive. Your implementation of the `ToString(String)` method should support the following: - A "G" format specifier that represents a customary or common format of the object. The parameterless overload of your object's `ToString` method should call its `ToString(String)` overload and pass it the "G" standard format string. @@ -247,7 +247,7 @@ A number of formatting or string conversion methods include a parameter of type - . Its implementation can return either a object to provide numeric formatting information or a object to provide formatting information for date and time values. -You can also implement your own format provider to replace any one of these classes. However, your implementation’s method must return an object of the type listed in the previous table if it has to provide formatting information to the `ToString` method. +You can also implement your own format provider to replace any one of these classes. However, your implementation's method must return an object of the type listed in the previous table if it has to provide formatting information to the `ToString` method. ### Culture-sensitive formatting of numeric values @@ -327,7 +327,7 @@ For more information about composite formatting, see [Composite Formatting](../. ## Custom formatting with ICustomFormatter -Two composite formatting methods, and , include a format provider parameter that supports custom formatting. When either of these formatting methods is called, it passes a object that represents an interface to the format provider’s method. The method is then responsible for returning the implementation that provides custom formatting. +Two composite formatting methods, and , include a format provider parameter that supports custom formatting. When either of these formatting methods is called, it passes a object that represents an interface to the format provider's method. The method is then responsible for returning the implementation that provides custom formatting. The interface has a single method, , that is called automatically by a composite formatting method, once for each format item in a composite format string. The method has three parameters: a format string, which represents the `formatString` argument in a format item, an object to format, and an object that provides formatting services. Typically, the class that implements also implements , so this last parameter is a reference to the custom formatting class itself. The method returns a custom formatted string representation of the object to be formatted. If the method cannot format the object, it should return a null reference (`Nothing` in Visual Basic). @@ -353,7 +353,6 @@ The following example uses the `ByteByByteFormatter` class to format integer val |[Custom TimeSpan Format Strings](../../../docs/standard/base-types/custom-timespan-format-strings.md)|Describes custom format strings that create application-specific formats for time intervals.| |[Enumeration Format Strings](../../../docs/standard/base-types/enumeration-format-strings.md)|Describes standard format strings that are used to create string representations of enumeration values.| |[Composite Formatting](../../../docs/standard/base-types/composite-formatting.md)|Describes how to embed one or more formatted values in a string. The string can subsequently be displayed on the console or written to a stream.| -|[Performing Formatting Operations](../../../docs/standard/base-types/performing-formatting-operations.md)|Lists topics that provide step-by-step instructions for performing specific formatting operations.| |[Parsing Strings](../../../docs/standard/base-types/parsing-strings.md)|Describes how to initialize objects to the values described by string representations of those objects. Parsing is the inverse operation of formatting.| ## Reference diff --git a/docs/standard/base-types/how-to-define-and-use-custom-numeric-format-providers.md b/docs/standard/base-types/how-to-define-and-use-custom-numeric-format-providers.md index ca049149cf3d2..b2be00e906ab5 100644 --- a/docs/standard/base-types/how-to-define-and-use-custom-numeric-format-providers.md +++ b/docs/standard/base-types/how-to-define-and-use-custom-numeric-format-providers.md @@ -78,8 +78,4 @@ The .NET Framework gives you extensive control over the string representation of [!code-csharp[System.ICustomFormatter.Format#1](../../../samples/snippets/csharp/VS_Snippets_CLR_System/system.ICustomFormatter.Format/cs/format.cs#1)] [!code-vb[System.ICustomFormatter.Format#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR_System/system.ICustomFormatter.Format/vb/Format.vb#1)] - In the case of this example, the method that implements is intended to serve as a callback method for the method. Therefore, it examines the `formatProvider` parameter to determine whether it contains a reference to the current `TelephoneFormatter` object. However, the method can also be called directly from code. In that case, you can use the `formatProvider` parameter to provide a or object that supplies culture-specific formatting information. - -## See also - -- [Performing Formatting Operations](../../../docs/standard/base-types/performing-formatting-operations.md) + In the case of this example, the method that implements is intended to serve as a callback method for the method. Therefore, it examines the `formatProvider` parameter to determine whether it contains a reference to the current `TelephoneFormatter` object. However, the method can also be called directly from code. In that case, you can use the `formatProvider` parameter to provide a or object that supplies culture-specific formatting information. diff --git a/docs/standard/base-types/how-to-display-dates-in-non-gregorian-calendars.md b/docs/standard/base-types/how-to-display-dates-in-non-gregorian-calendars.md index 41c164f334acc..8b619ceb31ce0 100644 --- a/docs/standard/base-types/how-to-display-dates-in-non-gregorian-calendars.md +++ b/docs/standard/base-types/how-to-display-dates-in-non-gregorian-calendars.md @@ -75,8 +75,4 @@ The and types use the Gregor - `DisplayDate`, an overloaded public method that is passed two parameters: either a or value to express in the calendar represented by the `CalendarUtility` object; and the culture whose formatting rules are to be used. Its behavior in returning the string representation of a date depends on whether the target calendar is supported by the culture whose formatting rules are to be used. - Regardless of the calendar used to create a or value in this example, that value is typically expressed as a Gregorian date. This is because the and types do not preserve any calendar information. Internally, they are represented as the number of ticks that have elapsed since midnight of January 1, 0001. The interpretation of that number depends on the calendar. For most cultures, the default calendar is the Gregorian calendar. - -## See also - -- [Performing Formatting Operations](../../../docs/standard/base-types/performing-formatting-operations.md) + Regardless of the calendar used to create a or value in this example, that value is typically expressed as a Gregorian date. This is because the and types do not preserve any calendar information. Internally, they are represented as the number of ticks that have elapsed since midnight of January 1, 0001. The interpretation of that number depends on the calendar. For most cultures, the default calendar is the Gregorian calendar. diff --git a/docs/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date.md b/docs/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date.md index 70ef192c6f554..4b1f89a12a24d 100644 --- a/docs/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date.md +++ b/docs/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date.md @@ -50,7 +50,7 @@ The .NET Framework makes it easy to determine the ordinal day of the week for a [!code-csharp[Formatting.Howto.WeekdayName#1](../../../samples/snippets/csharp/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/cs/abbrname1.cs#1)] [!code-vb[Formatting.Howto.WeekdayName#1](../../../samples/snippets/visualbasic/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/vb/abbrname1.vb#1)] - 2. To extract the abbreviated weekday name for a specific culture, call the date and time value’s or instance method. Pass the string "ddd" as the `format` parameter. Pass either a or a object that represents the culture whose weekday name you want to retrieve as the `provider` parameter. The following code illustrates a call to the method using a object that represents the fr-FR culture. + 2. To extract the abbreviated weekday name for a specific culture, call the date and time value's or instance method. Pass the string "ddd" as the `format` parameter. Pass either a or a object that represents the culture whose weekday name you want to retrieve as the `provider` parameter. The following code illustrates a call to the method using a object that represents the fr-FR culture. [!code-csharp[Formatting.Howto.WeekdayName#2](../../../samples/snippets/csharp/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/cs/abbrname2.cs#2)] [!code-vb[Formatting.Howto.WeekdayName#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/vb/abbrname2.vb#2)] @@ -61,12 +61,12 @@ The .NET Framework makes it easy to determine the ordinal day of the week for a 2. You can extract the full weekday name of the current culture or of a specific culture: - 1. To extract the weekday name for the current culture, call the date and time value’s or instance method, and pass the string "dddd" as the `format` parameter. The following example illustrates the call to the method. + 1. To extract the weekday name for the current culture, call the date and time value's or instance method, and pass the string "dddd" as the `format` parameter. The following example illustrates the call to the method. [!code-csharp[Formatting.Howto.WeekdayName#4](../../../samples/snippets/csharp/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/cs/fullname4.cs#4)] [!code-vb[Formatting.Howto.WeekdayName#4](../../../samples/snippets/visualbasic/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/vb/fullname4.vb#4)] - 2. To extract the weekday name for a specific culture, call the date and time value’s or instance method. Pass the string "dddd" as the `format` parameter. Pass either a or a object that represents the culture whose weekday name you want to retrieve as the `provider` parameter. The following code illustrates a call to the method using a object that represents the es-ES culture. + 2. To extract the weekday name for a specific culture, call the date and time value's or instance method. Pass the string "dddd" as the `format` parameter. Pass either a or a object that represents the culture whose weekday name you want to retrieve as the `provider` parameter. The following code illustrates a call to the method using a object that represents the es-ES culture. [!code-csharp[Formatting.Howto.WeekdayName#5](../../../samples/snippets/csharp/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/cs/fullname5.cs#5)] [!code-vb[Formatting.Howto.WeekdayName#5](../../../samples/snippets/visualbasic/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/vb/fullname5.vb#5)] @@ -90,10 +90,9 @@ The .NET Framework makes it easy to determine the ordinal day of the week for a You can also use the value returned by the property to retrieve the weekday name of a particular date. This requires only a call to the method on the value returned by the property. However, this technique does not produce a localized weekday name for the current culture, as the following example illustrates. [!code-csharp[Formatting.HowTo.WeekdayName#8](../../../samples/snippets/csharp/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/cs/Howto1.cs#8)] - [!code-vb[Formatting.HowTo.WeekdayName#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/vb/Howto1.vb#8)] - + [!code-vb[Formatting.HowTo.WeekdayName#8](../../../samples/snippets/visualbasic/VS_Snippets_CLR/Formatting.HowTo.WeekdayName/vb/Howto1.vb#8)] + ## See also -- [Performing Formatting Operations](../../../docs/standard/base-types/performing-formatting-operations.md) - [Standard Date and Time Format Strings](../../../docs/standard/base-types/standard-date-and-time-format-strings.md) - [Custom Date and Time Format Strings](../../../docs/standard/base-types/custom-date-and-time-format-strings.md) diff --git a/docs/standard/base-types/how-to-round-trip-date-and-time-values.md b/docs/standard/base-types/how-to-round-trip-date-and-time-values.md index 69ebecab147c6..fad55e6ac13fc 100644 --- a/docs/standard/base-types/how-to-round-trip-date-and-time-values.md +++ b/docs/standard/base-types/how-to-round-trip-date-and-time-values.md @@ -17,7 +17,7 @@ ms.assetid: b609b277-edc6-4c74-b03e-ea73324ecbdb In many applications, a date and time value is intended to unambiguously identify a single point in time. This topic shows how to save and restore a value, a value, and a date and time value with time zone information so that the restored value identifies the same time as the saved value. -### To round-trip a DateTime value +## Round-trip a DateTime value 1. Convert the value to its string representation by calling the method with the "o" format specifier. @@ -34,7 +34,7 @@ The following example illustrates how to round-trip a val When round-tripping a value, this technique successfully preserves the time for all local and universal times. For example, if a local value is saved on a system in the U.S. Pacific Standard Time zone and is restored on a system in the U.S. Central Standard Time zone, the restored date and time will be two hours later than the original time, which reflects the time difference between the two time zones. However, this technique is not necessarily accurate for unspecified times. All values whose property is are treated as if they are local times. If this is not the case, the will not successfully identify the correct point in time. The workaround for this limitation is to tightly couple a date and time value with its time zone for the save and restore operation. -### To round-trip a DateTimeOffset value +## Round-trip a DateTimeOffset value 1. Convert the value to its string representation by calling the method with the "o" format specifier. @@ -51,7 +51,7 @@ The following example illustrates how to round-trip a value as a single point in time. The value can then be converted to Coordinated Universal Time (UTC) by calling the method, or it can be converted to the time in a particular time zone by calling the or method. The major limitation of this technique is that date and time arithmetic, when performed on a value that represents the time in a particular time zone, may not produce accurate results for that time zone. This is because when a value is instantiated, it is disassociated from its time zone. Therefore, that time zone's adjustment rules can no longer be applied when you perform date and time calculations. You can work around this problem by defining a custom type that includes both a date and time value and its accompanying time zone. -### To round-trip a date and time value with its time zone +## Round-trip a date and time value with its time zone 1. Define a class or a structure with two fields. The first field is either a or a object, and the second is a object. The following example is a simple version of such a type. @@ -73,26 +73,25 @@ The following example illustrates how to round-trip an object that stores both d This technique should always unambiguously reflect the correct point of time both before and after it is saved and restored, provided that the implementation of the combined date and time and time zone object does not allow the date value to become out of sync with the time zone value. -## Compiling the Code +## Compile the code -These examples require: +These examples require that: -- That the following namespaces be imported with C# `using` statements or Visual Basic `Imports` statements: +- The following namespaces be imported with C# `using` directives or Visual Basic `Imports` statements: - - (C# only). + - (C# only) - - . + - - - . + - - - . + - - - . + - -- Each code example, other than the `DateInTimeZone` class, should be included in a class or Visual Basic module, wrapped in methods, and called from the `Main` method. +- Each code example, other than the `DateInTimeZone` class, be included in a class or Visual Basic module, wrapped in methods, and called from the `Main` method. ## See also -- [Performing Formatting Operations](../../../docs/standard/base-types/performing-formatting-operations.md) - [Choosing Between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo](../../../docs/standard/datetime/choosing-between-datetime.md) - [Standard Date and Time Format Strings](../../../docs/standard/base-types/standard-date-and-time-format-strings.md) diff --git a/docs/standard/base-types/index.md b/docs/standard/base-types/index.md deleted file mode 100644 index d1a7983702bba..0000000000000 --- a/docs/standard/base-types/index.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "Working with Base Types in .NET" -ms.date: "03/30/2017" -ms.technology: dotnet-standard -helpviewer_keywords: - - "types, base" - - "base types" - - "type system, base types" -ms.assetid: 028d0ce8-ebc2-4a88-a16f-17508f6d0bd6 ---- -# Working with Base Types in .NET -This section describes .NET base type operations, including formatting, conversion, and common operations. - -## In This Section - [Type Conversion in the .NET Framework](../../../docs/standard/base-types/type-conversion.md) - Describes how to convert from one type to another. - - [Formatting Types](../../../docs/standard/base-types/formatting-types.md) - Describes how to format strings using the string format specifiers. - - [Manipulating Strings](../../../docs/standard/base-types/manipulating-strings.md) - Describes how to manipulate and format strings. - - [Parsing Strings](../../../docs/standard/base-types/parsing-strings.md) - Describes how to convert strings into .NET Framework types. - -## Related Sections - [Common Type System](../../../docs/standard/base-types/common-type-system.md) - Describes types used by the .NET Framework. - - [Dates, Times, and Time Zones](../../../docs/standard/datetime/index.md) - Describes how to work with time zones and time zone conversions in time zone-aware applications. diff --git a/docs/standard/base-types/manipulating-strings.md b/docs/standard/base-types/manipulating-strings.md deleted file mode 100644 index acf11ed71cddf..0000000000000 --- a/docs/standard/base-types/manipulating-strings.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "Manipulating Strings in the .NET Framework" -ms.date: "03/30/2017" -ms.technology: dotnet-standard -helpviewer_keywords: - - "strings [.NET Framework], manipulating" - - "manipulating strings" -ms.assetid: d4568ff3-9f83-4549-acd8-47aec2194ac0 ---- -# Manipulating Strings in .NET -.NET provides an extensive set of routines that enable you to efficiently create, compare, and modify strings as well as rapidly parse large amounts of text and data to search for, remove, and replace text patterns. - -## In This Section - [Best Practices for Using Strings](../../../docs/standard/base-types/best-practices-strings.md) - Examines string-sorting, comparison, and casing methods in .NET, and provides recommendations for selecting a string-handling method . - - [.NET Regular Expressions](../../../docs/standard/base-types/regular-expressions.md) - Provides detailed information about .NET regular expressions, including language elements, regular expression behavior, and examples. - - [Basic String Operations](../../../docs/standard/base-types/basic-string-operations.md) - Describes string operations provided by the and classes, including creating new strings from arrays of bytes, comparing string values, and modifying existing strings. - -## Related Sections - [Type Conversion in .NET](../../../docs/standard/base-types/type-conversion.md) - Explains the techniques and rules used to convert types using .NET. - - [Formatting Types](../../../docs/standard/base-types/formatting-types.md) - Provides how to use the base class library to implement formatting, how to format numeric types, how to format string types, and how to format for a specific culture. - - [Parsing Strings](../../../docs/standard/base-types/parsing-strings.md) - Describes how to initialize objects to the values described by string representations of those objects. Parsing is the inverse operation of formatting. diff --git a/docs/standard/base-types/parsing-strings.md b/docs/standard/base-types/parsing-strings.md index d193ca9b0ba76..0b5f638af8d0c 100644 --- a/docs/standard/base-types/parsing-strings.md +++ b/docs/standard/base-types/parsing-strings.md @@ -28,7 +28,4 @@ A parsing operation converts a string that represents a .NET base type into that Describes basic formatting concepts like format specifiers and format providers. [Type Conversion in .NET](../../../docs/standard/base-types/type-conversion.md) - Describes how to convert types. - - [Base Types](../../../docs/standard/base-types/index.md) - Describes common operations that you can perform on .NET base types. + Describes how to convert types. diff --git a/docs/standard/base-types/performing-formatting-operations.md b/docs/standard/base-types/performing-formatting-operations.md deleted file mode 100644 index ac6b03c41f243..0000000000000 --- a/docs/standard/base-types/performing-formatting-operations.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "Performing Formatting Operations" -ms.date: "03/30/2017" -ms.technology: dotnet-standard -helpviewer_keywords: - - "date formatting [.NET Framework]" - - "formatting [.NET Framework], how-to topics" - - "time formatting [.NET Framework]" - - "formatting [.NET Framework], base types" - - "formatting strings [.NET Framework], how-to topics" - - "strings [.NET Framework], formatting" -ms.assetid: 36e7e096-4e6c-4cf2-9ab6-68073026ea0e ---- -# Performing Formatting Operations -The following topics provide step-by-step instructions for performing specific formatting operations. - -- [How to: Pad a Number with Leading Zeros](../../../docs/standard/base-types/how-to-pad-a-number-with-leading-zeros.md) - -- [How to: Define and Use Custom Numeric Format Providers](../../../docs/standard/base-types/how-to-define-and-use-custom-numeric-format-providers.md) - -- [How to: Extract the Day of the Week from a Specific Date](../../../docs/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date.md). - -- [How to: Round-trip Date and Time Values](../../../docs/standard/base-types/how-to-round-trip-date-and-time-values.md) - -- [How to: Display Milliseconds in Date and Time Values](../../../docs/standard/base-types/how-to-display-milliseconds-in-date-and-time-values.md) - -- [How to: Display Dates in Non-Gregorian Calendars](../../../docs/standard/base-types/how-to-display-dates-in-non-gregorian-calendars.md) - -## See also - -- [Formatting Types](../../../docs/standard/base-types/formatting-types.md) diff --git a/docs/standard/base-types/regular-expression-examples.md b/docs/standard/base-types/regular-expression-examples.md deleted file mode 100644 index 075d5a7788892..0000000000000 --- a/docs/standard/base-types/regular-expression-examples.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: "Regular Expression Examples" -ms.date: "03/30/2017" -ms.technology: dotnet-standard -helpviewer_keywords: - - "regular expressions [.NET Framework], examples" - - "regular expressions [.NET Framework]" - - "strings [.NET Framework], regular expressions" -ms.assetid: e9fd53f2-ed56-4b09-b2ea-e9bc9d65e6d6 ---- -# Regular Expression Examples -This section contains code examples that illustrate the use of regular expressions in common applications. - -> [!NOTE] -> The namespace contains a number of regular expression objects that implement predefined regular expression patterns for parsing strings from HTML, XML, and ASP.NET documents. For example, the class identifies start tags in a string and the class identifies ASP.NET comments in a string. - -## In This Section - [Example: Scanning for HREFs](../../../docs/standard/base-types/regular-expression-example-scanning-for-hrefs.md) - Provides an example that searches an input string and prints out all the href="…" values and their locations in the string. - - [Example: Changing Date Formats](../../../docs/standard/base-types/regular-expression-example-changing-date-formats.md) - Provides an example that replaces dates in the form mm/dd/yy with dates in the form dd-mm-yy. - - [How to: Extract a Protocol and Port Number from a URL](../../../docs/standard/base-types/how-to-extract-a-protocol-and-port-number-from-a-url.md) - Provides an example that extracts a protocol and port number from a string that contains a URL. For example, "http://www.contoso.com:8080/letters/readme.html" returns "http:8080". - - [How to: Strip Invalid Characters from a String](../../../docs/standard/base-types/how-to-strip-invalid-characters-from-a-string.md) - Provides an example that strips invalid non-alphanumeric characters from a string. - - [How to: Verify that Strings Are in Valid Email Format](../../../docs/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format.md) - Provides an example that verifies that a string is in valid email format. - -## Reference - - Provides class library reference information for the .NET **System.Text.RegularExpressions** namespace. - -## Related Sections - [.NET Regular Expressions](../../../docs/standard/base-types/regular-expressions.md) - Provides an overview of the programming language aspect of regular expressions. - - [The Regular Expression Object Model](../../../docs/standard/base-types/the-regular-expression-object-model.md) - Describes the regular expression classes contained in the `System.Text.RegularExpression` namespace and provides examples of their use. - - [Details of Regular Expression Behavior](../../../docs/standard/base-types/details-of-regular-expression-behavior.md) - Provides information about the capabilities and behavior of .NET regular expressions. - - [Regular Expression Language - Quick Reference](../../../docs/standard/base-types/regular-expression-language-quick-reference.md) - Provides information on the set of characters, operators, and constructs that you can use to define regular expressions. diff --git a/docs/standard/base-types/regular-expression-language-quick-reference.md b/docs/standard/base-types/regular-expression-language-quick-reference.md index ead52dadf7d77..a660a519fbb97 100644 --- a/docs/standard/base-types/regular-expression-language-quick-reference.md +++ b/docs/standard/base-types/regular-expression-language-quick-reference.md @@ -185,6 +185,5 @@ Miscellaneous constructs either modify a regular expression pattern or provide i - - [Regular Expressions](regular-expressions.md) - [Regular Expression Classes](the-regular-expression-object-model.md) -- [Regular Expression Examples](regular-expression-examples.md) - [Regular Expressions - Quick Reference (download in Word format)](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.docx) - [Regular Expressions - Quick Reference (download in PDF format)](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.pdf) diff --git a/docs/standard/base-types/regular-expressions.md b/docs/standard/base-types/regular-expressions.md index 450c56841c4e9..05fc85e0b03f4 100644 --- a/docs/standard/base-types/regular-expressions.md +++ b/docs/standard/base-types/regular-expressions.md @@ -21,10 +21,19 @@ helpviewer_keywords: - "strings [.NET Framework], regular expressions" ms.assetid: 521b3f6d-f869-42e1-93e5-158c54a6895d --- -# .NET Regular Expressions -Regular expressions provide a powerful, flexible, and efficient method for processing text. The extensive pattern-matching notation of regular expressions enables you to quickly parse large amounts of text to find specific character patterns; to validate text to ensure that it matches a predefined pattern (such as an email address); to extract, edit, replace, or delete text substrings; and to add the extracted strings to a collection in order to generate a report. For many applications that deal with strings or that parse large blocks of text, regular expressions are an indispensable tool. - -## How Regular Expressions Work +# .NET regular expressions + +Regular expressions provide a powerful, flexible, and efficient method for processing text. The extensive pattern-matching notation of regular expressions enables you to quickly parse large amounts of text to: + +- Find specific character patterns. +- Validate text to ensure that it matches a predefined pattern (such as an email address). +- Extract, edit, replace, or delete text substrings. +- Add extracted strings to a collection in order to generate a report. + +For many applications that deal with strings or that parse large blocks of text, regular expressions are an indispensable tool. + +## How regular expressions work + The centerpiece of text processing with regular expressions is the regular expression engine, which is represented by the object in .NET. At a minimum, processing text using regular expressions requires that the regular expression engine be provided with the following two items of information: - The regular expression pattern to identify in the text. @@ -33,7 +42,7 @@ Regular expressions provide a powerful, flexible, and efficient method for proce - The text to parse for the regular expression pattern. - The methods of the class let you perform the following operations: +The methods of the class let you perform the following operations: - Determine whether the regular expression pattern occurs in the input text by calling the method. For an example that uses the method for validating text, see [How to: Verify that Strings Are in Valid Email Format](how-to-verify-that-strings-are-in-valid-email-format.md). @@ -41,17 +50,22 @@ Regular expressions provide a powerful, flexible, and efficient method for proce - Replace text that matches the regular expression pattern by calling the method. For examples that use the method to change date formats and remove invalid characters from a string, see [How to: Strip Invalid Characters from a String](how-to-strip-invalid-characters-from-a-string.md) and [Example: Changing Date Formats](regular-expression-example-changing-date-formats.md). - For an overview of the regular expression object model, see [The Regular Expression Object Model](the-regular-expression-object-model.md). - - For more information about the regular expression language, see [Regular Expression Language - Quick Reference](regular-expression-language-quick-reference.md) or download and print one of these brochures: +For an overview of the regular expression object model, see [The Regular Expression Object Model](the-regular-expression-object-model.md). - [Quick Reference in Word (.docx) format](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.docx) - [Quick Reference in PDF (.pdf) format](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.pdf) +For more information about the regular expression language, see [Regular Expression Language - Quick Reference](regular-expression-language-quick-reference.md) or download and print one of these brochures: -## Regular Expression Examples - The class includes a number of string search and replacement methods that you can use when you want to locate literal strings in a larger string. Regular expressions are most useful either when you want to locate one of several substrings in a larger string, or when you want to identify patterns in a string, as the following examples illustrate. +- [Quick Reference in Word (.docx) format](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.docx) +- [Quick Reference in PDF (.pdf) format](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.pdf) -### Example 1: Replacing Substrings +## Regular expression examples + +The class includes a number of string search and replacement methods that you can use when you want to locate literal strings in a larger string. Regular expressions are most useful either when you want to locate one of several substrings in a larger string, or when you want to identify patterns in a string, as the following examples illustrate. + +> [!TIP] +> The namespace contains a number of regular expression objects that implement predefined regular expression patterns for parsing strings from HTML, XML, and ASP.NET documents. For example, the class identifies start tags in a string and the class identifies ASP.NET comments in a string. + +### Example 1: Replace substrings + Assume that a mailing list contains names that sometimes include a title (Mr., Mrs., Miss, or Ms.) along with a first and last name. If you do not want to include the titles when you generate envelope labels from the list, you can use a regular expression to remove the titles, as the following example illustrates. [!code-csharp[Conceptual.Regex#2](~/samples/snippets/csharp/VS_Snippets_CLR/conceptual.regex/cs/example1.cs#2)] @@ -59,7 +73,8 @@ Regular expressions provide a powerful, flexible, and efficient method for proce The regular expression pattern `(Mr\.? |Mrs\.? |Miss |Ms\.? )` matches any occurrence of "Mr ", "Mr. ", "Mrs ", "Mrs. ", "Miss ", "Ms or "Ms. ". The call to the method replaces the matched string with ; in other words, it removes it from the original string. -### Example 2: Identifying Duplicated Words +### Example 2: Identify duplicated words + Accidentally duplicating words is a common error that writers make. A regular expression can be used to identify duplicated words, as the following example shows. [!code-csharp[Conceptual.Regex#3](~/samples/snippets/csharp/VS_Snippets_CLR/conceptual.regex/cs/example2.cs#3)] @@ -67,51 +82,55 @@ Regular expressions provide a powerful, flexible, and efficient method for proce The regular expression pattern `\b(\w+?)\s\1\b` can be interpreted as follows: -||| -|-|-| -|`\b`|Start at a word boundary.| -|(\w+?)|Match one or more word characters, but as few characters as possible. Together, they form a group that can be referred to as `\1`.| -|`\s`|Match a white-space character.| -|`\1`|Match the substring that is equal to the group named `\1`.| -|`\b`|Match a word boundary.| +> [!div class="mx-tdCol2BreakAll"] +> |Pattern|Interpretation| +> |-|-| +> |`\b`|Start at a word boundary.| +> |`(\w+?)`|Match one or more word characters, but as few characters as possible. Together, they form a group that can be referred to as `\1`.| +> |`\s`|Match a white-space character.| +> |`\1`|Match the substring that is equal to the group named `\1`.| +> |`\b`|Match a word boundary.| The method is called with regular expression options set to . Therefore, the match operation is case-insensitive, and the example identifies the substring "This this" as a duplication. Note that the input string includes the substring "this? This". However, because of the intervening punctuation mark, it is not identified as a duplication. -### Example 3: Dynamically Building a Culture-Sensitive Regular Expression +### Example 3: Dynamically build a culture-sensitive regular expression + The following example illustrates the power of regular expressions combined with the flexibility offered by .NET's globalization features. It uses the object to determine the format of currency values in the system's current culture. It then uses that information to dynamically construct a regular expression that extracts currency values from the text. For each match, it extracts the subgroup that contains the numeric string only, converts it to a value, and calculates a running total. [!code-csharp[Conceptual.Regex#1](~/samples/snippets/csharp/VS_Snippets_CLR/conceptual.regex/cs/example.cs#1)] [!code-vb[Conceptual.Regex#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.regex/vb/example.vb#1)] On a computer whose current culture is English - United States (en-US), the example dynamically builds the regular expression `\$\s*[-+]?([0-9]{0,3}(,[0-9]{3})*(\.[0-9]+)?)`. This regular expression pattern can be interpreted as follows: - -||| -|-|-| -|`\$`|Look for a single occurrence of the dollar symbol (`$`) in the input string. The regular expression pattern string includes a backslash to indicate that the dollar symbol is to be interpreted literally rather than as a regular expression anchor. (The `$` symbol alone would indicate that the regular expression engine should try to begin its match at the end of a string.) To ensure that the current culture's currency symbol is not misinterpreted as a regular expression symbol, the example calls the method to escape the character.| -|`\s*`|Look for zero or more occurrences of a white-space character.| -|`[-+]?`|Look for zero or one occurrence of either a positive sign or a negative sign.| -|`([0-9]{0,3}(,[0-9]{3})*(\.[0-9]+)?)`|The outer parentheses around this expression define it as a capturing group or a subexpression. If a match is found, information about this part of the matching string can be retrieved from the second object in the object returned by the property. (The first element in the collection represents the entire match.)| -|`[0-9]{0,3}`|Look for zero to three occurrences of the decimal digits 0 through 9.| -|`(,[0-9]{3})*`|Look for zero or more occurrences of a group separator followed by three decimal digits.| -|`\.`|Look for a single occurrence of the decimal separator.| -|`[0-9]+`|Look for one or more decimal digits.| -|`(\.[0-9]+)?`|Look for zero or one occurrence of the decimal separator followed by at least one decimal digit.| + +> [!div class="mx-tdCol2BreakAll"] +> |Pattern|Interpretation| +> |-|-| +> |`\$`|Look for a single occurrence of the dollar symbol (`$`) in the input string. The regular expression pattern string includes a backslash to indicate that the dollar symbol is to be interpreted literally rather than as a regular expression anchor. (The `$` symbol alone would indicate that the regular expression engine should try to begin its match at the end of a string.) To ensure that the current culture's currency symbol is not misinterpreted as a regular expression symbol, the example calls the method to escape the character.| +> |`\s*`|Look for zero or more occurrences of a white-space character.| +> |`[-+]?`|Look for zero or one occurrence of either a positive sign or a negative sign.| +> |`([0-9]{0,3}(,[0-9]{3})*(\.[0-9]+)?)`|The outer parentheses around this expression define it as a capturing group or a subexpression. If a match is found, information about this part of the matching string can be retrieved from the second object in the object returned by the property. (The first element in the collection represents the entire match.)| +> |`[0-9]{0,3}`|Look for zero to three occurrences of the decimal digits 0 through 9.| +> |`(,[0-9]{3})*`|Look for zero or more occurrences of a group separator followed by three decimal digits.| +> |`\.`|Look for a single occurrence of the decimal separator.| +> |`[0-9]+`|Look for one or more decimal digits.| +> |`(\.[0-9]+)?`|Look for zero or one occurrence of the decimal separator followed by at least one decimal digit.| If each of these subpatterns is found in the input string, the match succeeds, and a object that contains information about the match is added to the object. -## Related Topics +## Related topics |Title|Description| |-----------|-----------------| |[Regular Expression Language - Quick Reference](regular-expression-language-quick-reference.md)|Provides information on the set of characters, operators, and constructs that you can use to define regular expressions.| |[The Regular Expression Object Model](the-regular-expression-object-model.md)|Provides information and code examples that illustrate how to use the regular expression classes.| -|[Details of Regular Expression Behavior](details-of-regular-expression-behavior.md)|Provides information about the capabilities and behavior of .NET regular expressions.| -|[Regular Expression Examples](regular-expression-examples.md)|Provides code examples that illustrate typical uses of regular expressions.| +|[Details of Regular Expression Behavior](details-of-regular-expression-behavior.md)|Provides information about the capabilities and behavior of .NET regular expressions.| +|[Use regular expressions in Visual Studio](/visualstudio/ide/using-regular-expressions-in-visual-studio)|| ## Reference - - - [Regular Expressions - Quick Reference (download in Word format)](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.docx) - [Regular Expressions - Quick Reference (download in PDF format)](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.pdf) + +- +- +- [Regular Expressions - Quick Reference (download in Word format)](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.docx) +- [Regular Expressions - Quick Reference (download in PDF format)](https://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.pdf) diff --git a/docs/standard/base-types/toc.yml b/docs/standard/base-types/toc.yml deleted file mode 100644 index 1179271378feb..0000000000000 --- a/docs/standard/base-types/toc.yml +++ /dev/null @@ -1,131 +0,0 @@ -- name: Base Types - href: index.md - items: - - name: Common Type System - href: common-type-system.md - - name: Type Conversion in .NET - href: type-conversion.md - items: - - name: Type Conversion Tables - href: conversion-tables.md - - name: Formatting Types - href: formatting-types.md - items: - - name: Standard Numeric Format Strings - href: standard-numeric-format-strings.md - - name: Custom Numeric Format Strings - href: custom-numeric-format-strings.md - - name: Standard Date and Time Format Strings - href: standard-date-and-time-format-strings.md - - name: Custom Date and Time Format Strings - href: custom-date-and-time-format-strings.md - - name: Standard TimeSpan Format Strings - href: standard-timespan-format-strings.md - - name: Custom TimeSpan Format Strings - href: custom-timespan-format-strings.md - - name: Enumeration Format Strings - href: enumeration-format-strings.md - - name: Composite Formatting - href: composite-formatting.md - - name: Performing Formatting Operations - href: performing-formatting-operations.md - items: - - name: "How to: Pad a Number with Leading Zeros" - href: how-to-pad-a-number-with-leading-zeros.md - - name: "How to: Extract the Day of the Week from a Specific Date" - href: how-to-extract-the-day-of-the-week-from-a-specific-date.md - - name: "How to: Define and Use Custom Numeric Format Providers" - href: how-to-define-and-use-custom-numeric-format-providers.md - - name: "How to: Round-trip Date and Time Values" - href: how-to-round-trip-date-and-time-values.md - - name: "How to: Display Milliseconds in Date and Time Values" - href: how-to-display-milliseconds-in-date-and-time-values.md - - name: "How to: Display Dates in Non-Gregorian Calendars" - href: how-to-display-dates-in-non-gregorian-calendars.md - - name: Manipulating Strings - href: manipulating-strings.md - items: - - name: Best Practices for Using Strings - href: best-practices-strings.md - - name: Basic String Operations - href: basic-string-operations.md - items: - - name: Creating New Strings - href: creating-new.md - - name: Trimming and Removing Characters - href: trimming.md - - name: Padding Strings - href: padding.md - - name: Comparing Strings - href: comparing.md - - name: Changing Case - href: changing-case.md - - name: Using the StringBuilder Class - href: stringbuilder.md - - name: "How to: Perform Basic String Manipulations" - href: basic-manipulations.md - - name: Regular Expressions in .NET - href: regular-expressions.md - items: - - name: Regular Expression Language - Quick Reference - href: regular-expression-language-quick-reference.md - items: - - name: Character Escapes - href: character-escapes-in-regular-expressions.md - - name: Character Classes - href: character-classes-in-regular-expressions.md - - name: Anchors - href: anchors-in-regular-expressions.md - - name: Grouping Constructs - href: grouping-constructs-in-regular-expressions.md - - name: Quantifiers - href: quantifiers-in-regular-expressions.md - - name: Backreference Constructs - href: backreference-constructs-in-regular-expressions.md - - name: Alternation Constructs - href: alternation-constructs-in-regular-expressions.md - - name: Substitutions - href: substitutions-in-regular-expressions.md - - name: Regular Expression Options - href: regular-expression-options.md - - name: Miscellaneous Constructs - href: miscellaneous-constructs-in-regular-expressions.md - - name: Best Practices for Regular Expressions - href: best-practices.md - - name: The Regular Expression Object Model - href: the-regular-expression-object-model.md - - name: Details of Regular Expression Behavior - href: details-of-regular-expression-behavior.md - items: - - name: Backtracking - href: backtracking-in-regular-expressions.md - - name: Compilation and Reuse - href: compilation-and-reuse-in-regular-expressions.md - - name: Thread Safety - href: thread-safety-in-regular-expressions.md - - name: Regular Expression Examples - href: regular-expression-examples.md - items: - - name: "Example: Scanning for HREFs" - href: regular-expression-example-scanning-for-hrefs.md - - name: "Example: Changing Date Formats" - href: regular-expression-example-changing-date-formats.md - - name: "How to: Extract a Protocol and Port Number from a URL" - href: how-to-extract-a-protocol-and-port-number-from-a-url.md - - name: "How to: Strip Invalid Characters from a String" - href: how-to-strip-invalid-characters-from-a-string.md - - name: "How to verify that strings are in valid email format" - href: how-to-verify-that-strings-are-in-valid-email-format.md - - name: Character encoding in .NET - href: character-encoding-introduction.md - - name: How to use character encoding classes - href: character-encoding.md - - name: Parsing Strings - href: parsing-strings.md - items: - - name: Parsing Numeric Strings - href: parsing-numeric.md - - name: Parsing Date and Time Strings - href: parsing-datetime.md - - name: Parsing Other Strings - href: parsing-other.md diff --git a/docs/standard/index.md b/docs/standard/index.md index 769d8dc39ddda..f7bd939a01f0c 100644 --- a/docs/standard/index.md +++ b/docs/standard/index.md @@ -40,7 +40,6 @@ For more information about the major concepts of .NET, see: * [.NET Standard](net-standard.md) * [Native interoperability](native-interop/index.md) * [Garbage collection](garbage-collection/index.md) -* [Base types in .NET](base-types/index.md) * [Collections](collections/index.md) * [Dates, times, and time zones](datetime/index.md) * [Asynchronous programming](async.md) diff --git a/docs/standard/io/types-of-isolation.md b/docs/standard/io/types-of-isolation.md index 77963dc9880a9..115726c8ce901 100644 --- a/docs/standard/io/types-of-isolation.md +++ b/docs/standard/io/types-of-isolation.md @@ -26,7 +26,7 @@ Access to isolated storage is always restricted to the user who created it. To i - Domain identity represents the evidence of the application, which in the case of a web application might be the full URL. For shell-hosted code, the domain identity might be based on the application directory path. For example, if the executable runs from the path C:\Office\MyApp.exe, the domain identity would be C:\Office\MyApp.exe. -- Assembly identity is the evidence of the assembly. This might come from a cryptographic digital signature, which can be the assembly's [strong name](../assembly/strong-named.md), the software publisher of the assembly, or its URL identity. If an assembly has both a strong name and a software publisher identity, then the software publisher identity is used. If the assembly comes from the Internet and is unsigned, the URL identity is used. For more information about assemblies and strong names, see [Programming with Assemblies](../assembly/program.md). +- Assembly identity is the evidence of the assembly. This might come from a cryptographic digital signature, which can be the assembly's [strong name](../assembly/strong-named.md), the software publisher of the assembly, or its URL identity. If an assembly has both a strong name and a software publisher identity, then the software publisher identity is used. If the assembly comes from the Internet and is unsigned, the URL identity is used. For more information about assemblies and strong names, see [Programming with Assemblies](/dotnet/standard/assembly/index). - Roaming stores move with a user that has a roaming user profile. Files are written to a network directory and are downloaded to any computer the user logs into. For more information about roaming user profiles, see . diff --git a/docs/standard/numerics.md b/docs/standard/numerics.md index 23d4acd76571b..ffc3b03bbca60 100644 --- a/docs/standard/numerics.md +++ b/docs/standard/numerics.md @@ -89,5 +89,4 @@ The SIMD-enabled types are implemented in such a way that they can be used with ## See also -- [Application Essentials](application-essentials.md) - [Standard Numeric Format Strings](base-types/standard-numeric-format-strings.md) diff --git a/docs/standard/toc.yml b/docs/standard/toc.yml index f69554aa1341e..2cf7e341fe381 100644 --- a/docs/standard/toc.yml +++ b/docs/standard/toc.yml @@ -38,8 +38,140 @@ href: framework-libraries.md - name: Class library overview href: class-library-overview.md - - name: Base types - href: base-types/ + - name: Work with base types + items: + - name: Common type system + href: base-types/common-type-system.md + - name: Type conversion in .NET + href: base-types/type-conversion.md + - name: Type conversion tables + href: base-types/conversion-tables.md + - name: Format numbers, dates, other types + items: + - name: Overview + href: base-types/formatting-types.md + - name: Standard numeric format strings + href: base-types/standard-numeric-format-strings.md + - name: Custom numeric format strings + href: base-types/custom-numeric-format-strings.md + - name: Standard date and time format strings + href: base-types/standard-date-and-time-format-strings.md + - name: Custom date and time format strings + href: base-types/custom-date-and-time-format-strings.md + - name: Standard TimeSpan format strings + href: base-types/standard-timespan-format-strings.md + - name: Custom TimeSpan format strings + href: base-types/custom-timespan-format-strings.md + - name: Enumeration format strings + href: base-types/enumeration-format-strings.md + - name: Composite formatting + href: base-types/composite-formatting.md + - name: How-tos + items: + - name: Pad a number with leading zeros + href: base-types/how-to-pad-a-number-with-leading-zeros.md + - name: Extract the day of the week from a date + href: base-types/how-to-extract-the-day-of-the-week-from-a-specific-date.md + - name: Use custom numeric format providers + href: base-types/how-to-define-and-use-custom-numeric-format-providers.md + - name: Round-trip date and time values + href: base-types/how-to-round-trip-date-and-time-values.md + - name: Display milliseconds in date and time values + href: base-types/how-to-display-milliseconds-in-date-and-time-values.md + - name: Display dates in non-Gregorian calendars + href: base-types/how-to-display-dates-in-non-gregorian-calendars.md + - name: Manipulate strings + items: + - name: Best practices for using strings + href: base-types/best-practices-strings.md + - name: Basic string operations + items: + - name: Overview + href: base-types/basic-string-operations.md + displayName: string operations + - name: Create new strings + href: base-types/creating-new.md + - name: Trim and remove characters + href: base-types/trimming.md + - name: Pad strings + href: base-types/padding.md + - name: Compare strings + href: base-types/comparing.md + - name: Change case + href: base-types/changing-case.md + - name: Use the StringBuilder class + href: base-types/stringbuilder.md + - name: "How to: Perform basic string manipulations" + href: base-types/basic-manipulations.md + - name: Regular expressions in .NET + items: + - name: Overview + href: base-types/regular-expressions.md + displayName: regular expressions + - name: Language reference + items: + - name: Overview + href: base-types/regular-expression-language-quick-reference.md + - name: Character escapes + href: base-types/character-escapes-in-regular-expressions.md + - name: Character classes + href: base-types/character-classes-in-regular-expressions.md + - name: Anchors + href: base-types/anchors-in-regular-expressions.md + - name: Grouping constructs + href: base-types/grouping-constructs-in-regular-expressions.md + - name: Quantifiers + href: base-types/quantifiers-in-regular-expressions.md + - name: Backreference constructs + href: base-types/backreference-constructs-in-regular-expressions.md + - name: Alternation constructs + href: base-types/alternation-constructs-in-regular-expressions.md + - name: Substitutions + href: base-types/substitutions-in-regular-expressions.md + - name: Regular expression options + href: base-types/regular-expression-options.md + - name: Miscellaneous constructs + href: base-types/miscellaneous-constructs-in-regular-expressions.md + - name: Best practices for regular expressions + href: base-types/best-practices.md + - name: Regular expression object model + href: base-types/the-regular-expression-object-model.md + - name: Regular expression behavior + items: + - name: Overview + href: base-types/details-of-regular-expression-behavior.md + - name: Backtracking + href: base-types/backtracking-in-regular-expressions.md + - name: Compilation and reuse + href: base-types/compilation-and-reuse-in-regular-expressions.md + - name: Thread safety + href: base-types/thread-safety-in-regular-expressions.md + - name: Examples + items: + - name: Scan for HREFs + href: base-types/regular-expression-example-scanning-for-hrefs.md + - name: Change date formats + href: base-types/regular-expression-example-changing-date-formats.md + - name: Extract a protocal and port number from a URL + href: base-types/how-to-extract-a-protocol-and-port-number-from-a-url.md + - name: Strip invalid characters from a string + href: base-types/how-to-strip-invalid-characters-from-a-string.md + - name: Verify that strings are in valid email format + href: base-types/how-to-verify-that-strings-are-in-valid-email-format.md + - name: Character encoding in .NET + href: base-types/character-encoding-introduction.md + - name: How to use character encoding classes + href: base-types/character-encoding.md + - name: Parse strings + items: + - name: Overview + href: base-types/parsing-strings.md + - name: Parse numeric strings + href: base-types/parsing-numeric.md + - name: Parse date and time strings + href: base-types/parsing-datetime.md + - name: Parse other strings + href: base-types/parsing-other.md - name: .NET class libraries href: class-libraries.md - name: Analyzers @@ -141,8 +273,6 @@ href: metadata-and-self-describing-components.md - name: Create console apps href: building-console-apps.md -- name: Application essentials - href: application-essentials.md - name: File and stream I/O href: io/index.md - name: Globalization and localization