Class Index | File Index

Classes


Class KJUR.lang.String


Version 1.0 (2016-Aug-05).
String and its utility class
Defined in: base64x-1.1.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
String and its utility class
This class provides some static utility methods for string.
Method Summary
Method Attributes Method Name and Description
<static>  
KJUR.lang.String.isBase64(s)
check whether a string is a base64 encoded string or not
Input string can conclude new lines or space characters.
<static>  
KJUR.lang.String.isBase64URL(s)
check whether a string is a base64url encoded string or not
Input string can conclude new lines or space characters.
<static>  
KJUR.lang.String.isHex(s)
check whether a string is an hexadecimal string or not (DEPRECATED)
<static>  
KJUR.lang.String.isIA5(s)
check whether a string consists of IAString characters
<static>  
KJUR.lang.String.isInteger(s)
check whether a string is an integer string or not
<static>  
KJUR.lang.String.isIntegerArray(s)
check whether a string is a string of integer array or not
Input string can conclude new lines or space characters.
<static>  
KJUR.lang.String.isMail(s)
check whether a string is RFC 822 mail address
<static>  
KJUR.lang.String.isPrintable(s)
check whether a string consists of PrintableString characters
Class Detail
KJUR.lang.String()
String and its utility class
This class provides some static utility methods for string.
This class provides static methods for string utility.
STRING TYPE CHECKERS

Author: Kenji Urushima.
Since:
base64x 1.1.7 jsrsasign 5.0.13
Method Detail
<static> {Boolean} KJUR.lang.String.isBase64(s)
check whether a string is a base64 encoded string or not
Input string can conclude new lines or space characters.
KJUR.lang.String.isBase64("YWE=") → true
KJUR.lang.String.isBase64("YW_=") → false
KJUR.lang.String.isBase64("YWE") → false -- length shall be multiples of 4
Parameters:
{String} s
input string
Since:
base64x 1.1.7 jsrsasign 5.0.13
Returns:
{Boolean} true if a string "s" is a base64 encoded string otherwise false

<static> {Boolean} KJUR.lang.String.isBase64URL(s)
check whether a string is a base64url encoded string or not
Input string can conclude new lines or space characters.
KJUR.lang.String.isBase64URL("YWE") → true
KJUR.lang.String.isBase64URL("YW-") → true
KJUR.lang.String.isBase64URL("YW+") → false
Parameters:
{String} s
input string
Since:
base64x 1.1.7 jsrsasign 5.0.13
Returns:
{Boolean} true if a string "s" is a base64url encoded string otherwise false

<static> {Boolean} KJUR.lang.String.isHex(s)
check whether a string is an hexadecimal string or not (DEPRECATED)
KJUR.lang.String.isHex("1234") → true
KJUR.lang.String.isHex("12ab") → true
KJUR.lang.String.isHex("12AB") → true
KJUR.lang.String.isHex("12ZY") → false
KJUR.lang.String.isHex("121") → false -- odd length
Parameters:
{String} s
input string
Deprecated:
from 10.0.6. please use ishex
Since:
base64x 1.1.7 jsrsasign 5.0.13
Returns:
{Boolean} true if a string "s" is an hexadecimal string otherwise false
See:
ishex

<static> {Boolean} KJUR.lang.String.isIA5(s)
check whether a string consists of IAString characters
KJUR.lang.String.isIA5("abc") → true
KJUR.lang.String.isIA5('"abc"') → false
KJUR.lang.String.isIA5("あいう") → false
Parameters:
{String} s
input string
Since:
jsrsasign 9.0.0 base64x 1.1.16 A IA5String consists of following characters
%x00-21/%x23-7F (i.e. ASCII characters excludes double quote(%x22)
This method returns false when other characters than above. Otherwise it returns true.
Returns:
{Boolean} true if a string "s" consists of IA5String characters

<static> {Boolean} KJUR.lang.String.isInteger(s)
check whether a string is an integer string or not
KJUR.lang.String.isInteger("12345") → true
KJUR.lang.String.isInteger("123ab") → false
Parameters:
{String} s
input string
Since:
base64x 1.1.7 jsrsasign 5.0.13
Returns:
{Boolean} true if a string "s" is an integer string otherwise false

<static> {Boolean} KJUR.lang.String.isIntegerArray(s)
check whether a string is a string of integer array or not
Input string can conclude new lines or space characters.
KJUR.lang.String.isIntegerArray("[1,2,3]") → true
KJUR.lang.String.isIntegerArray("  [1, 2, 3  ] ") → true
KJUR.lang.String.isIntegerArray("[a,2]") → false
Parameters:
{String} s
input string
Since:
base64x 1.1.7 jsrsasign 5.0.13
Returns:
{Boolean} true if a string "s" is a string of integer array otherwise false

<static> {Boolean} KJUR.lang.String.isMail(s)
check whether a string is RFC 822 mail address
KJUR.lang.String.isMail("abc") → false
KJUR.lang.String.isMail("abc@example") → false
KJUR.lang.String.isMail("abc@example.com") → true
Parameters:
{String} s
input string
Since:
jsrsasign 9.0.0 base64x 1.1.16 This static method will check string s is RFC 822 compliant mail address.
Returns:
{Boolean} true if a string "s" RFC 822 mail address

<static> {Boolean} KJUR.lang.String.isPrintable(s)
check whether a string consists of PrintableString characters
KJUR.lang.String.isPrintable("abc") → true
KJUR.lang.String.isPrintable("abc@") → false
KJUR.lang.String.isPrintable("あいう") → false
Parameters:
{String} s
input string
Since:
jsrsasign 9.0.0 base64x 1.1.16 A PrintableString consists of following characters
0-9A-Za-z '()+,-./:=?
This method returns false when other characters than above. Otherwise it returns true.
Returns:
{Boolean} true if a string "s" consists of PrintableString characters

© 2012-2023 Kenji Urushima, All rights reserved
Documentation generated by JsDoc Toolkit 2.4.0