Description:
This method returns the primitive value of a String object.
Syntax:
string.valueOf( )
Here is the detail of parameters:
NA
Return Value:
Returns the primitive value of a String object.
Example:
<html>
<head>
<title>JavaScript String valueOf() Method</title>
</head>
<body>
<script type="text/javascript">
var str = new String("Hello world");
document.write(str.valueOf(...
SVN, iOS, VB.Net, JAVA, PHP, Python, Ruby, Perl, HTML, CSS, Javascript, MySQL, C++, UNIX,Tutorial, Examples,
Javascript String - toUpperCase() Method
4/6/14
Description:
This method returns the calling string value converted to uppercase.
Syntax:
string.toUpperCase( )
Here is the detail of parameters:
NA
Return Value:
Returns a string representing the specified object.
Example:
<html>
<head>
<title>JavaScript String toUpperCase() Method</title>
</head>
<body>
<script type="text/javascript">
var str = "Apples are round,...
Javascript String - toString() Method
4/6/14
Description:
This method returns a string representing the specified object.
Syntax:
string.toString( )
Here is the detail of parameters:
NA
Return Value:
Returns a string representing the specified object.
Example:
<html>
<head>
<title>JavaScript String toString() Method</title>
</head>
<body>
<script type="text/javascript">
var str = "Apples are round, and Apples...
Javascript String - toLowerCase() Method
4/6/14
Description:
This method returns the calling string value converted to lowercase.
Syntax:
string.toLowerCase( )
Here is the detail of parameters:
NA
Return Value:
Returns the calling string value converted to lowercase.
Example:
<html>
<head>
<title>JavaScript String toLowerCase() Method</title>
</head>
<body>
<script type="text/javascript">
var str = "Apples are round,...
Javascript String - toLocaleUpperCase() Method
4/6/14
Description:
This method is used to convert the characters within a string to upper case while respecting the current locale. For most languages, this will return the same as toUpperCase.
Syntax:
string.toLocaleUpperCase( )
Here is the detail of parameters:
NA
Return Value:
A string into upper case with the current locale.
Example:
<html>
<head>
<title>JavaScript String toLocaleUpperCase()...
Javascript String - toLocaleLowerCase() Method
4/6/14
Description:
This method is used to convert the characters within a string to lower case while respecting the current locale. For most languages, this will return the same as toLowerCase.
Syntax:
string.toLocaleLowerCase( )
Here is the detail of parameters:
NA
Return Value:
A string into lower case with the current locale.
Example:
<html>
<head>
<title>JavaScript String toLocaleLowerCase()...
Javascript String - substring() Method
4/6/14
Description:
This method returns a subset of a String object.
Syntax:
string.substring(indexA, [indexB])
Here is the detail of parameters:
indexA : An integer between 0 and one less than the length of the string.
indexB : (optional) An integer between 0 and the length of the string.
Return Value:
The substring method returns the new sub string based on given parameters.
Example:
<html>
<head>
<title>JavaScript...
Javascript String - substr() Method
4/6/14
Description:
This method returns the characters in a string beginning at the specified location through the specified number of characters.
Syntax:
string.substr(start[, length]);
Here is the detail of parameters:
start : Location at which to begin extracting characters (an integer between 0 and one less than the length of the string).
length : The number of characters to extract.
Note: If start...
Javascript String - split() Method
4/6/14
Description:
This method splits a String object into an array of strings by separating the string into substrings.
Syntax:
string.split([separator][, limit]);
Here is the detail of parameters:
separator : Specifies the character to use for separating the string. If separator is omitted, the array returned contains one element consisting of the entire string.
limit : Integer specifying a limit on...
Javascript String - slice() Method
4/6/14
Description:
This method extracts a section of a string and returns a new string.
Syntax:
string.slice( beginslice [, endSlice] );
Here is the detail of parameters:
beginSlice : The zero-based index at which to begin extraction.
endSlice : The zero-based index at which to end extraction. If omitted, slice extracts to the end of the string.
Note: As a negative index, endSlice indicates an offset from...
Javascript String - search() Method
4/6/14
Description:
This method Executes the search for a match between a regular expression and this String object.
Syntax:
string.search(regexp);
Here is the detail of parameters:
regexp : A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj)
Return Value:
If successful, search returns the index of the regular expression inside the string....
Javascript String - replace() Method
4/6/14
Description:
This method finds a match between a regular expression and a string, and replaces the matched substring with a new substring.
The replacement string can include the following special replacement patterns:
PatternInserts
$$Inserts a "$".
$&Inserts the matched substring.
$`Inserts the portion of the string that precedes the matched substring.
$'Inserts the portion of the string that follows the matched substring.
$n...
Javascript String - match() Method
4/6/14
Description:
This method is used to retrieve the matches when matching a string against a regular expression.
Syntax:
string.match( param )
Here is the detail of parameters:
param : A regular expression object.
Return Value:
If the regular expression does not include the g flag, returns the same result as regexp.exec(string).
If the regular expression includes the g flag, the method returns an Array containing...
Javascript String - length Property
4/6/14
Description:
This property returns the number of characters in the string.
Syntax:
string.length
Here is the detail of parameters:
A string
Return Value:
Returns the number of characters in the string.
Example:
<html>
<head>
<title>JavaScript String length Property</title>
</head>
<body>
<script type="text/javascript">
var str = new String( "This is string" );
document.write("str.length...
Javascript String - localeCompare() Method
4/6/14
Description:
This method returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.
Syntax:
string.localeCompare( param )
Here is the detail of parameters:
param : A string to be compared with string object.
Return Value:
0 : It string matches 100%.
1 : no match, and the parameter value comes before the string object's...
Javascript String - lastIndexOf() Method
4/6/14
Description:
This method returns the index within the calling String object of the last occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.lastIndexOf(searchValue[, fromIndex])
Here is the detail of parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start...
Javascript String - indexOf() Method
4/6/14
Description:
This method returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.indexOf(searchValue[, fromIndex])
Here is the detail of parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the...
Javascript String - concat() Method
4/6/14
Description:
This method adds two or more strings and returns a new single string.
Syntax:
string.concat(string2, string3[, ..., stringN]);
Here is the detail of parameters:
string2...stringN : These are the strings to be concatenated.
Return Value:
Returns a single concatenated string.
Example:
<html>
<head>
<title>JavaScript String concat() Method</title>
</head>
<body>
<script...
Javascript String - charCodeAt() Method
4/6/14
Description:
This method returns a number indicating the Unicode value of the character at the given index.
Unicode code points range from 0 to 1,114,111. The first 128 Unicode code points are a direct match of the ASCII character encoding. The charCodeAt() will always return a value that is less than 65,536.
Syntax:
string.charCodeAt(index);
Here is the detail of parameters:
index: An integer between...
Javascript String - charAt() Method
4/6/14
Description:
This method returns the character from the specified index.
Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called stringName is stringName.length - 1.
Syntax:
string.charAt(index);
Here is the detail of parameters:
index: An integer between 0 and 1 less than the length of the string.
Return Value:
Returns...
Subscribe to:
Posts (Atom)
Related Posts
-
If you want to list down your website, book or any other resource on this page then please contact at webmaster@tutorialspoint.com CSS 1...
-
This is a complete reference guide for web developers where haved we listed all the CSS properties defined in the World Wide Web Consortium...
-
If you think this PDF is worth of $5.99 value, kindly pay this little amount using a Credit Card or PayPal for the PDF. Download CSS Tu...
-
Description: This method creates an HTML anchor that is used as a hypertext target. Syntax: string .anchor( anchorname ) Here is ...
-
Description: This method returns a number indicating whether a reference string comes before or after or is the same as the given string ...
-
Description: Javascript array unshift() method adds one or more elements to the beginning of an array and returns the new length of the...
-
Description: This method converts a number object, into a human readable string representing the number using the locale of the environ...
-
Description: Javascript boolean valueOf() method returns the primitive value of the specified boolean object.. Syntax: boolean .va...
-
Description: This method returns the index within the calling String object of the last occurrence of the specified value, starting the s...
-
Description: Javascript array toString() method returns a string representing the source code of the specified array and its elements. ...