HtmlTextWriter.SpaceChar Field

Definition

Represents a space ( ) character.

C#
public const char SpaceChar;

Field Value

Examples

This section provides two code examples. The first one demonstrates how to create a character array. The second one demonstrates how to use the array.

These code examples generate the following markup:

<label>

hello world

</label>

The following code example shows how to create a Char array that contains the SpaceChar field.

C#
private char[] testChars = {'h', 'e', 'l', 'l', 'o',
    HtmlTextWriter.SpaceChar ,'w', 'o', 'r', 'l', 'd'};

The following code example shows how to use the array that was created in the preceding code example as a parameter when calling the Write method.

C#
// Render a character array as the 
// contents of a <label> element.
writer.RenderBeginTag(HtmlTextWriterTag.Label);
writer.Write(testChars);
writer.RenderEndTag();

Remarks

The SpaceChar field is used by the RenderBeginTag and WriteAttribute methods when writing separators between elements and attributes.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also