문제

aSimple question i got, what's the easiest way to check if my String includes any alphabetic characters?? rather than streaming over it. I tried "isAlphaNumeric" gives me an error.

 |a|
 a:= '1625.46brd'.
 "check if a includes alphabets "
도움이 되었습니까?

해결책

a anySatisfy: [ :char | char isLetter ]

Here you iterate a as a Collection and check if any character is a letter. If you want it not only letters (I understand alphabet as letters) you can send isAlphaNumeric message.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top