Full check and half check

Source: Internet
Author: User
The original author does not know who it is. If you infringe your rights and interests, please contact me!

During outsourcing work to Japan, you often need to perform full check and half check on the entered characters]

① [Fullwidth check ]/**//**
* [Number of shards] isZenKana
* [Device power] full-width failover without manual failover
* [Xiaoming] the full-width characters in the text column "" include "まるか る"
* [Reference]
* @ Param str text Column
* [Return Renewal]
* @ Return true (including commandid before success) | false (including commandid before success)
*/
Function isZenKana (str ){
Var zen = 'Too many attempts have been made even though there are too many attempts to be made. please refer to the following link for more information: ';
Var mes = '';
For (var I = 0; I <str. length; I ++ ){
/** // * Specify 1 text in the text column */
Var tmp1 = str. substr (I, 1 );
For (var j = 0; j <zen. length; j ++ ){
Var tmp2 = zen. substr (j, 1 );
/** // * Contains the entire batch of rows without errors */
If (tmp1 = tmp2 ){
MES + = ''+ tmp1 + '」';
}
}
}
If (mes! = ''){
/** // * The full-width dynamic route includes Dynamic Route tables and dynamic route tables */
// Alert (mes + 'nn full-width neural networks including neural networks ');
Return true;
} Else {
/** // * The full-width dynamic route consists of Dynamic Route tables and dynamic route tables */
// Alert. ');
Return false;
}
}

② [Halfwidth check]

/**//**
* [Users] isHanKana
* [Machine energy] half-width camera Clock
* [Simming] the half-width characters in the text column contain too many characters.
* [Reference]
* @ Param str text Column
* [Return Renewal]
* @ Return true (including commandid before success) | false (including commandid before success)
*/
Function isHanKana (str ){
Var zen = 'Too many attempts have been made even though there are too many attempts to be made. please refer to the following link for more information: when there are too many threads, there are too many threads, too many threads, etc ';
Var mes = '';
For (var I = 0; I <str. length; I ++ ){
/** // * Specify 1 text in the text column */
VaR tmp1 = Str. substr (I, 1 );
For (var j = 0; j <Zen. length; j ++ ){
VaR tmp2 = Zen. substr (J, 1 );
/** // * Contains the entire batch of rows without errors */
If (tmp1 = tmp2 ){
MES + = ''+ tmp1 + '」';
}
}
}
If (mes! = ''){
/** // * The half-width Navigation Pane contains a joint scene */
// Alert (mes + 'nn full-width neural networks including neural networks ');
Return true;
} Else {
/** // * The half-width scene contains a joint scene */
// Alert. ');
Return false;
}
}

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.