sub

Causes a string to be displayed as a subscript, as if it were in a SUB tag.

Applies to

String

Syntax

sub()

Parameters

None

Description

Use the sub method with the Write method to format and display a string in a document.

Example

The following example uses the sub and sup methods to format a string:

var superText="superscript"
var subText="subscript"

Console.Write("This is what a " + superText.sup() + " looks like.")
Console.Write("<P>This is what a " + subText.sub() + " looks like.")

The previous example produces the same output as the following HTML:

This is what a <SUP>superscript</SUP> looks like.
<P>This is what a <SUB>subscript</SUB> looks like.

See also

String:sup