This static tool class defined each of the following methods returns a copy of the string wrapped inside an HTML tag.
For example,
HTMLStringFormatter.bold("test") returns
test.
Compatibility with Javascript String HTML wrappers, this methods are native in the Javascript String class.
public static function anchor(str:String, name:String):String
Creates an HTML anchor that is used as a hypertext target.
Parameters
| str:String — the string to be formatted.
|
| |
| name:String — the name of the anchor.
|
Returns
| String — the string formatted with the method.
|
public static function big(str:String):String
Use the big method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function blink(str:String):String
Use the blink method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function bold(str:String):String
Use the bold method to format and display a string in a document.
var s:String = HTMLStringFormatter.bold("hello world") ;
trace("bold : " + s) ; // bold : <b>hello world</b>
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function fixed(str:String):String
Use the fixed method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function fontColor(str:String, color:String):String
Use the fontColor method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
| |
| color:String — the string hexadecimal RGB triplet with the format rrggbb.
|
Returns
| String — the string formatted with the method.
|
public static function fontSize(str:String, size:Number):String
Use the fontColor method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
| |
| size:Number — an Integer representing the size of the font.
|
Returns
| String — the string formatted with the method.
|
public static function italics(str:String):String
Use the italics method to format and display a string in a document.
import vegas.string.HTMLStringFormatter ;
var s:String = HTMLStringFormatter.italics("hello world") ;
trace("italics : " + s) ; // italics : <i>hello world</i>
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function link(str:String, url:String = "", target:String = null):String
Creates an HTML hypertext link that requests another URL.
import vegas.string.HTMLStringFormatter ;
var s:String = HTMLStringFormatter.link("hello world", "http://ekameleon.net/blog", "_blank") ;
trace("link : " + s) ; // link : <a href="http://google.fr" target="_blank">hello world</a>
Parameters
| str:String — the string to be formatted.
|
| |
| url:String (default = "") — any string that specifies the HREF of the A tag; it should be a valid URL (relative or absolute).
|
| |
| target:String (default = null) — (optional) this value defined to the anchor tag forces the load of that link into the targeted window.
|
Returns
| String — the string formatted with the method.
|
public static function paragraph(str:String, style:String = null):String
Creates an HTML paragraph HTML string in a document.
import vegas.string.HTMLStringFormatter ;
var s:String = HTMLStringFormatter.paragraph("hello world") ;
trace("paragraph : " + s) ; // paragraph : <p>hello world</p>
var s:String = HTMLStringFormatter.paragraph("hello world", "myStyle") ;
trace("paragraph : " + s) ; // paragraph : <p class="myStyle">hello world</p>
Parameters
| str:String — the string to be formatted.
|
| |
| style:String (default = null) — (optional) the style class name of the tag.
|
Returns
| String — the string formatted with the method.
|
public static function small(str:String):String
Use the small method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function span(str:String, style:String = null):String
Creates an HTML span string in a document.
import vegas.string.HTMLStringFormatter ;
var sP:String = HTMLStringFormatter.span("hello world") ;
trace("span : " + sP) ; // span : <span>hello world</span>
var sP:String = HTMLStringFormatter.span("hello world", "myStyle") ;
trace("span : " + sP) ; // span : <span class="myStyle">hello world</span>
Parameters
| str:String — the string to be formatted.
|
| |
| style:String (default = null) — (optional) the style class name of the tag.
|
Returns
| String — the string formatted with the method.
|
public static function strike(str:String):String
Use the strike method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function sub(str:String):String
Use the sub method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function sup(str:String):String
Use the sup method to format and display a string in a document.
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|
public static function underline(str:String):String
Use the underline method to format and display a string in a document.
import vegas.string.HTMLStringFormatter ;
var s:String = HTMLStringFormatter.underline("hello world") ;
trace("underline : " + s) ; // underline : <u>hello world</u>
Parameters
| str:String — the string to be formatted.
|
Returns
| String — the string formatted with the method.
|