JavaScript
Here is a library of JavaScript Code Samples. More will be added as they become available.
JavaScript String Examples
String Object Properties |
constructor |
Returns the function that created the String object's prototype |
length |
Returns the length of a string |
prototype |
Allows you to add properties and methods to an object |
|
String HTML Wrapper Methods |
anchor() |
Creates an anchor |
big() |
Shows the string using a big font |
blink() |
Shows a blinking string |
bold() |
Shows string as bold |
fixed() |
Shows the string using a fixed font |
fontcolor() |
Shows a string in fontcolor |
fontsize() |
Shows a string in fontsize |
italics() |
Shows the string using italics font |
link() |
Shows a string as a link |
small() |
Shows the string using small font |
strike() |
Shows the string using a strikethrough font |
sub() |
Shows a string using subscript font |
sup() |
Shows the string using a superscript font |
String Object Methods |
charAt() |
Returns the character at the specified index |
charCodeAt() |
Returns the Unicode of the character at the specified index |
concat() |
returns joined strings |
fromCharCode() |
Converts Unicode values to characters |
indexOf() |
Returns the position of the first found occurrence of a specified value in a string |
lastIndexOf() |
Returns the position of the last found occurrence of a specified value in a string |
match() |
Returns the matchs between a regular expression and a string |
replace() |
Replaces the matched strings with a new strings |
search() |
Returns the position of a string |
slice() |
Returns a part of a string |
split() |
Splits a string into an array of substrings |
substr() |
Returns a portion of the original string |
substring() |
Returns a portion of the original string |
toLowerCase() |
Converts string to lowercase |
toUpperCase() |
Converts string to uppercase |
valueOf() |
Returns the value of the original string |
|
|