★★ Java の宿題ここで答えます Part 67 ★★at TECH
★★ Java の宿題ここで答えます Part 67 ★★ - 暇つぶし2ch253:デフォルトの名無しさん
09/03/13 19:18:19
>>252
public boolean isValidPwd(String input)
{
if(input.length()<8)return false;
boolean conDigit=false;
boolean conLower=false;
boolean conUpper=false;
boolean conSpecial=false;
for(char c:input.toCharArray()){
if(!conDigit&&Character.isDigit(c))conDigit = true;
if(!conLower&&Character.isLowerCase(c))conLower = true;
if(!conUpper&&Character.isUpperCase(c))conUpper = true;
if(!conSpecial&&c=='~')conSpecial = true;
if(!conSpecial&&c=='!')conSpecial = true;
if(!conSpecial&&c=='@')conSpecial = true;
if(!conSpecial&&c=='#')conSpecial = true;
if(!conSpecial&&c=='$')conSpecial = true;
if(!conSpecial&&c=='%')conSpecial = true;
if(!conSpecial&&c=='&')conSpecial = true;
if(!conSpecial&&c=='^')conSpecial = true;
if(!conSpecial&&c=='*')conSpecial = true;

}
return conDigit&&conLower&&conUpper&&conSpecial;
}



次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch