filmov
tv
JavaScript String Functions | JavaScript String Methods - JavaScript Tutorial 87
Показать описание
Notes for You:: JavaScript String Functions.
var name = "I am javascript language";
d.w(name); // I am javascript language
JavaScript String Properties:
length:
- returns the total number of characters in a given string.
Ex:
JavaScript String Functions:
charAt(index:Number):String
- returns a new string containing a character at the specified index.
Ex:
charCodeAt(index:Number):Number
- returns the ASCII value of the character at the specified index.
Ex:
indexOf(value:String):Number
- searches the string from left to right and returns the index of the first occurrence of the given value .
Ex:
lastIndexOf(value:String):Number
- searches the string from left to right and returns the index of the last occurrence of the given value.
Ex:
toLowerCase():String
- returns a new string, with all uppercase characters converted to lowercase.
Ex:
toUpperCase():String
- returns a new string, with all lowercase characters converted to uppercase.
Ex:
substr(startIndex:Number, len:Number):String
- returns a substring consisting of the characters that start at the specified startIndex and with a length specified by len.
Ex:
substring(startIndex:Number, endIndex:Number):String
- returns a string consisting of the characters specified by startIndex and all characters up to endIndex -1.
Ex:
slice(startIndex:Number, endIndex:Number):String
- returns a string that includes the startIndex character and all characters up to endIndex -1.
Ex:
startsWith(value:String):Boolean
- returns true if the given string begins with the given string value else returns false.
Ex:
endsWith(value:String):Boolean
- returns true if the given string ends with the given string value else returns false.
Ex:
concat(str1:String, str2:String,... ):String
- returns a new string by combining the given strings.
Ex:
d.w( "I".concat(" am"," JavaScript") );
d.w("I" + " am" + " JavaScipt");
split(seperator:String):Array
- splits a String object into an array of substrings by dividing it wherever the specified seperator occurs.
Ex:
d.w(words[0]); // I
d.w(words[1]); // am
d.w(words[2]); // javascript
d.w(words[3]); // language
valueOf():String
- returns the primitive value of a String object.
Ex:
var number = new String("244");
d.w(typeof number); // object
Note:
=========================================
Follow the link for next video:
JavaScript Tutorial 88 - JavaScript RegExp Object | JavaScript RegExp Methods
Follow the link for previous video:
JavaScript Tutorial 86 - How to create Strings in JavaScript | JavaScript Strings
=========================================
JavaScript Tutorials Playlist:-
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
jQuery UI Tutorials Playlist:-
Bootstrap Tutorials Playlist:-
=========================================
Subscribe to our YouTube channel:-
Join as member of our YouTube channel:-
Become our Patron:-
Visit our Website:-
Download our Notes from Instamojo:-
Buy our Products on Spring:-
=========================================
Follow us:-
Google My Business:-
Google Blog:-
LinkedIn:-
Facebook:-
Twitter:-
Tumblr:-
Pinterest:-
=========================================
Despite my inconsistent uploads; Thanks for being amazing learners and still sticking with me on YouTube.
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
var name = "I am javascript language";
d.w(name); // I am javascript language
JavaScript String Properties:
length:
- returns the total number of characters in a given string.
Ex:
JavaScript String Functions:
charAt(index:Number):String
- returns a new string containing a character at the specified index.
Ex:
charCodeAt(index:Number):Number
- returns the ASCII value of the character at the specified index.
Ex:
indexOf(value:String):Number
- searches the string from left to right and returns the index of the first occurrence of the given value .
Ex:
lastIndexOf(value:String):Number
- searches the string from left to right and returns the index of the last occurrence of the given value.
Ex:
toLowerCase():String
- returns a new string, with all uppercase characters converted to lowercase.
Ex:
toUpperCase():String
- returns a new string, with all lowercase characters converted to uppercase.
Ex:
substr(startIndex:Number, len:Number):String
- returns a substring consisting of the characters that start at the specified startIndex and with a length specified by len.
Ex:
substring(startIndex:Number, endIndex:Number):String
- returns a string consisting of the characters specified by startIndex and all characters up to endIndex -1.
Ex:
slice(startIndex:Number, endIndex:Number):String
- returns a string that includes the startIndex character and all characters up to endIndex -1.
Ex:
startsWith(value:String):Boolean
- returns true if the given string begins with the given string value else returns false.
Ex:
endsWith(value:String):Boolean
- returns true if the given string ends with the given string value else returns false.
Ex:
concat(str1:String, str2:String,... ):String
- returns a new string by combining the given strings.
Ex:
d.w( "I".concat(" am"," JavaScript") );
d.w("I" + " am" + " JavaScipt");
split(seperator:String):Array
- splits a String object into an array of substrings by dividing it wherever the specified seperator occurs.
Ex:
d.w(words[0]); // I
d.w(words[1]); // am
d.w(words[2]); // javascript
d.w(words[3]); // language
valueOf():String
- returns the primitive value of a String object.
Ex:
var number = new String("244");
d.w(typeof number); // object
Note:
=========================================
Follow the link for next video:
JavaScript Tutorial 88 - JavaScript RegExp Object | JavaScript RegExp Methods
Follow the link for previous video:
JavaScript Tutorial 86 - How to create Strings in JavaScript | JavaScript Strings
=========================================
JavaScript Tutorials Playlist:-
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
jQuery UI Tutorials Playlist:-
Bootstrap Tutorials Playlist:-
=========================================
Subscribe to our YouTube channel:-
Join as member of our YouTube channel:-
Become our Patron:-
Visit our Website:-
Download our Notes from Instamojo:-
Buy our Products on Spring:-
=========================================
Follow us:-
Google My Business:-
Google Blog:-
LinkedIn:-
Facebook:-
Twitter:-
Tumblr:-
Pinterest:-
=========================================
Despite my inconsistent uploads; Thanks for being amazing learners and still sticking with me on YouTube.
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
Комментарии