Skip to content

isAlpha

isAlpha(str, extra?): boolean

Check whether given str is alphabetic string.

The allowed characters are A-Z, and a-z.

Example

isAlpha("foobar")
// => true
isAlpha("foobar123")
// => false
isAlpha("foobar123", "123")
// => true

Parameters

str

string

The string to check for alphabetic characters.

extra?

string

Extra characters that are allowed.

Returns

boolean

str consists of alphabetic characters.