Packagevegas.string
Classpublic class HTMLStringFormatter

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 Methods
 MethodDefined by
  
anchor(str:String, name:String):String
[static] Creates an HTML anchor that is used as a hypertext target.
HTMLStringFormatter
  
big(str:String):String
[static] Use the big method to format and display a string in a document.
HTMLStringFormatter
  
blink(str:String):String
[static] Use the blink method to format and display a string in a document.
HTMLStringFormatter
  
bold(str:String):String
[static] Use the bold method to format and display a string in a document.
HTMLStringFormatter
  
fixed(str:String):String
[static] Use the fixed method to format and display a string in a document.
HTMLStringFormatter
  
fontColor(str:String, color:String):String
[static] Use the fontColor method to format and display a string in a document.
HTMLStringFormatter
  
fontSize(str:String, size:Number):String
[static] Use the fontColor method to format and display a string in a document.
HTMLStringFormatter
  
italics(str:String):String
[static] Use the italics method to format and display a string in a document.
HTMLStringFormatter
  
link(str:String, url:String = "", target:String = null):String
[static] Creates an HTML hypertext link that requests another URL.
HTMLStringFormatter
  
paragraph(str:String, style:String = null):String
[static] Creates an HTML paragraph HTML string in a document.
HTMLStringFormatter
  
small(str:String):String
[static] Use the small method to format and display a string in a document.
HTMLStringFormatter
  
span(str:String, style:String = null):String
[static] Creates an HTML span string in a document.
HTMLStringFormatter
  
strike(str:String):String
[static] Use the strike method to format and display a string in a document.
HTMLStringFormatter
  
sub(str:String):String
[static] Use the sub method to format and display a string in a document.
HTMLStringFormatter
  
sup(str:String):String
[static] Use the sup method to format and display a string in a document.
HTMLStringFormatter
  
underline(str:String):String
[static] Use the underline method to format and display a string in a document.
HTMLStringFormatter
Method detail
anchor()method
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.
big()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.
blink()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.
bold()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.
fixed()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.
fontColor()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.
fontSize()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.
italics()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.
link()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.
paragraph()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.
small()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.
span()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.
strike()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.
sub()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.
sup()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.
underline()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.