2021/12/17) 13. 大文字と小文字の変換
1.質問
<大文字と小文字の変換>
:大文字と小文字が同じ文字列を入力することで、ライタは大文字と小文字を大文字と小文字に変換して出力します.
2.解決方法
前に習った内容どおりにすればいいです.
3.正解
<script>
function solution(s){
let answer="";
for(let x of s){
if(x===x.toUpperCase()) answer+=x.toLowerCase();
else answer+=x.toUpperCase();
}
return answer;
}
console.log(solution("StuDY"));
</script>
Reference
この問題について(2021/12/17) 13. 大文字と小文字の変換), 我々は、より多くの情報をここで見つけました https://velog.io/@7lo9ve3/20211217-13.-대소문자-변환テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol