Angular--Angular.uppercase, Angular.lowercase, Angular.fromjson, Angular.tojson

Source: Internet
Author: User

Angular.uppercase

Converts the specified string to uppercase

format : Angular.uppercase (String);

String: is converted to uppercase.

Using code:

  var str = "Abcabc";  var uppercase = angular.uppercase (str); //abcabc   

Angular.lowercase

Converts the specified string to lowercase

format : Angular.lowercase (String);

String: converted to lowercase strings.

Using code:

 var str = "Abcabc";  var lowercase = angular.lowercase (str); //abcabc   

The translation of these two methods is also not very difficult and easy to understand. When we are comparing or doing some string processing, we need to convert the uppercase and lowercase strings to all upper case or all lower cases, both of which are used at this time ...

Angular. Fromjson

Deserializing JSON strings

format : Angular.fromjson (str)

String in Str:json format

Using code:

var str = ' [{' name ': ' A ', ' Age ': ' 1 '}, {' name ': ' B ', ' Age ': ' 2 '}, {' name ': ' C ', ' Age ': ' 3 '}] ';  var con = Angular.fromjson (str);  con=[{' name ': ' A ', ' Age ': ' 1 '}, {' name ': ' B ', ' Age ': ' 2 '}, {' name ': ' C ', ' Age ': ' 3 '}]    

Angular. ToJson

Serializing a JSON string

format : Angular.tojson (str)

STR: JSON data to be transferred to string (JSON-formatted string).

Using code:

var str = [{' Name ': ' A ', ' Age ': ' 1 '}, {' name ': ' B ', ' Age ': ' 2 '}, {' name ': ' C ', ' Age ': ' 3 ' }];  var con = Angular.tojson (str);  //con = "[{\" name\ ": \" A\ ", \" age\ ": \" 1\ "}, {\" name\ ": \" b\ ", \" age\ ": \" 2\ "}, {\" name\ ": \" c\ ", \" age\ ": \" 3\ "}]"   

The above is the use of these two methods, Angular.fromjson is to convert the JSON format of the string into JSON format data, the lake person called "deserialization json string"; Angular.tojson is to convert JSON-formatted data into "JSON-formatted string" (although a bit around the mouth, but its essence is a string), the lake person called "serialized JSON string."

Angular--Angular.uppercase, Angular.lowercase, Angular.fromjson, Angular.tojson

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.