2017-04-21 16:42:29 +00:00
|
|
|
module Helpers exposing (isNotEmptyTrimmedAlphabetWord)
|
|
|
|
|
|
|
|
import String
|
|
|
|
|
|
|
|
|
|
|
|
isNotEmptyTrimmedAlphabetWord : String -> Bool
|
|
|
|
isNotEmptyTrimmedAlphabetWord string =
|
|
|
|
let
|
|
|
|
stringLength =
|
|
|
|
String.length string
|
|
|
|
in
|
2018-09-06 16:08:51 +00:00
|
|
|
stringLength
|
|
|
|
/= 0
|
|
|
|
&& String.length (String.filter isLetter string)
|
|
|
|
== stringLength
|
2017-04-21 16:42:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
isLetter : Char -> Bool
|
|
|
|
isLetter char =
|
2018-09-06 16:08:51 +00:00
|
|
|
String.contains (String.fromChar char) lowerCaseAlphabet
|
|
|
|
|| String.contains (String.fromChar char) upperCaseAlphabet
|
2017-04-21 16:42:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
lowerCaseAlphabet : String
|
|
|
|
lowerCaseAlphabet =
|
|
|
|
"abcdefghijklmnopqrstuvwxyz"
|
|
|
|
|
|
|
|
|
|
|
|
upperCaseAlphabet : String
|
|
|
|
upperCaseAlphabet =
|
|
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|