News
IBM to offer mobile security as a service IBM will start delivering mobile security-as-a-service (MaaS) through its own cloud infrastructure in India, a move that is expected to better address in-country data requirements... IBM Spectrum Computing: IBM has enlarged its portfolio of software-defined infrastructure solutions with cognitive features for workload management.  * LiFi internet technology has been introduced, the new type of wireless internet connection that gives 100 times faster than traditional WiFi -- Invented by Professor Harald Haas from the University of Edinburgh. * Sci. Rachid Yazami has developed a smart chip that charges smartphones in less than 10 minutes. BenQ has launched BlueCore projector - Consumer electronics major BenQ has launched its first BlueCore laser light source projector. For those unaware, devices with BlueCore laser technology have a high contrast output of 80000:1 with an extended lamp life and efficiency. ***
  Nov 30 2014 8:32AM     Anand
  0 Comments    856 Views  
Here Anand gave such a good explanation about string methods in Javascript.
charAt() Method
This Method takes the integer value and Returns the character at the specified position.
Example:
var StrChar = str.charAt(4);
This will produce the following result as "D".
charCodeAt()
This is similer to CharAt() method,But it returns the Unicode of the character at the specified position.
Example:
var StrCharCode = str.charCodeAt(5);
This will produce the following result as "101".
concat()
This method takes two string as input and returns a new joined string.
Example:
var Str2 = "Beyond the Knowledge"
  var ConcatString = str.concat(Str2);
This will produce the following result as "The Developer Tips Beyond the Knowledge".
fromCharCode()
This method is similer to charCodeAt(), It takes unicode value and returns the character.
Example:
var charCode = str.fromCharCode(69);
This will produce the following result as "D".
charAt() Method
This Method takes the integer value and Returns the character at the specified position.
Example:
var StrChar = str.charAt(4);
This will produce the following result as "D".
indexOf()
It Returns the position of the first occurrence of a specified value in a string.
Example:
var indexOf = str.indexOf("e");
This will produce the following result as "2".
lastIndexOf()
It Returns the position of the last occurrence of a specified value in a string.
Example:
var lastIndexOf = str.lastIndexOf("e");
This will produce the following result as "11".
match()
Searches a string or a character for a match against a regular expression, and returns the matches in object.
Example:
var matchedWords = str.match(/e/u);
This will produce the following result as " ["e""e""e""e"] ".
replace()
This method replace the new string with the existing string and returns the string where the specified values are replaced.
Example:
var strReplace = str.replace("Tips","Tips.com");
This will produce the result as "The Developer Tips.com".
slice()
It takes two integer value from index and to indexand and returns the string from the specified position.
Example:
var strSlice = str.slice(4,13);
This will produce the result as "Developer".
split()
This method is frequently used javascript method and Splits a string into an array of substrings.
Example:
var strSplit = str.split(" ");
Now, The string "The Developer Tips" splited in to three parts by space and store in strSplit Array.This will produce the result.
a[0] - "The"
a[1] - "Developer"
a[2] - "Tips"
trim()
This method removes whitespace from both ends of string.
Example:
var str3 = " The Developer Tips ";
var strTrim = str3.trim();
And now, The result will be "The Developer Tips".
toLowerCase()
Converts a string to lowercase letters.
Example:
var strLowerCase = str.toLowerCase();
This will returns the string with all lower case "The developer tips".
toUpperCase()
Converts a string to uppercase letters.
Example:
var strLowerCase = str.toUpperCase();
This will returns the string with all Upper case "THE DEVELOPER TIPS".
Hi, This is Anand.I hope this page will helps you to Convert JSON Result to Java script Object and bind dynamically in table.Thanks.
BackToTop
Comments



 
Search
1&1 Hosting
Recent Posts
Bind Gridview from CSV file in Asp.Net C#
Jun 18 2016 11:38PM Posted By Michael
Call WebService method from jQuery in every 1 minute
Feb 27 2016 11:51AM Posted By John
Gridview custom CSS in ASP.Net
Feb 25 2016 10:59AM Posted By Micheal Ryan
Read excel file and bind to Gridview in C#
Feb 25 2016 10:20AM Posted By Micheal
Read excel file and convert to List in C#
Feb 25 2016 6:26AM Posted By Michael
Encryption and Decryption for Password in C#
Feb 17 2016 3:52AM Posted By Michael
How to create Chart in ASP.Net C#
Feb 16 2016 8:03AM Posted By Michael Ryan
Tags
Follow us on Facebook
Follow us on Google +
Recent post in your Email inbox.
Enter your email address: