Alphanumericals
are a combination of alphabetical and numerical characters. Generally, the Latin letters and Arabic digits are used to create alphanumerically. Alphanumeric does not contain special characters like “*,~.:-?” etc.
Alphanumericals
是字母和数字字符的组合。 通常,拉丁字母和阿拉伯数字用于字母数字创建。 字母数字不包含特殊字符,例如“ *,〜。:-?” 等等
字母或字母(Alpha or Alphabetical)
Alpha
or Alphabetical
specifies the Latin letters. These letters can be lower case or uppercase. These Latin letters also expressed as A-Z+a-z.
Alpha
或Alphabetical
指定拉丁字母。 这些字母可以是小写或大写。 这些拉丁字母也表示为A-Z + az。
数字 (Numeric )
Numeric is the number part where Arabic numbers which are actually from 0-9 are used.
数字是数字部分,使用的阿拉伯数字实际上是0-9。
Python isalphanumeric()函数 (Python isalphanumeric() Function)
Most of the programming languages provide functions in order to check if given character set or string or text is alphanumeric. Python is one of them where is provides the isalnum()
function. In the following examples we will use this function to the if given text is alphanumeric.
大多数编程语言都提供功能,以检查给定的字符集或字符串或文本是否为字母数字。 Python是其中的其中之一,其中提供了isalnum()
函数。 在以下示例中,如果给定的文本是字母数字,我们将使用此功能。
text="abc123ABC123"
text.isalnum()
# The output will be True
text="abc123ABC123."
text.isalnum()
# The output will be False
text="abc123ABC123?"
text.isalnum()
# The output will be False
text="abc"
text.isalnum()
# The output will be True
text="123"
text.isalnum()
# The output will be True