Flex string comparisons and flex string Operations _flex

Source: Internet
Author: User
The simplest way is to use the ">", "<", ">=", "<=", "!=" and "= =" and so on comparison modifier, or you do not trust yourself, and write some methods to do multi-layer verification,
There is also a very powerful trace (); To tell the truth, use less, hehe, but in the coding process the experiment is used quite a lot.
In fact, Flex is converting these characters into ASCII code to compare them. As long as it's a string, you can try it out in this way, of course, other types are OK.
if (reuserpwd.text!=userpwd.text) {//Confirm password and original password comparison alert.show (' Two passwords must be the same, please check ', ' hint ', 4, NULL, NULL, ALERTICON); return False }
The code is relatively few, use this one should be able to express.
There is also the addition of a string operation on the content.
1:
Format: string name. substr (start subscript, substring length);
Format: string name. substring (start subscript, end subscript);
Slice method: The same as the substring method features and parameters, but there are two differences: 1.substring method parameters If negative will automatically convert to 0, and slice method will be considered the penultimate.
The 2.substring method ends the subscript less than the start subscript to represent the slice string, but the method does not have the function.
Format: string name. substring (start subscript, end subscript);
2: Compare,
Here really is their own stupid home, oh, looking for a long time, the original comparison of whether they are equal to a = = or is!= on the deal, but also thought very complex, hey, really blame himself did not have more brains, what all want ready-made.
And I wrote a way to compare it myself. Hey, stupid home,
In fact, a lot of things directly jdk can be done, oh, I write these, are completely super simple.
Next time write a little bit of check things up, hehe

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.