대문자 찾기
문제 한 개의 문자열을 입력받아 해당 문자열에 알파벳 대문자가 몇 개 있는지 알아내는 프로그램을 작성하세요. 첫 줄에 문자열이 입력됩니다. (길이는 100을 넘지 않습니다.) 첫 줄에 대문자의 개수를 출력합니다. 입력값 : KoreaTimeGood 출력값 : 3 풀이 function solution(str) { const answer = str.match(/[A-Z]/g).length; return answer; } let str = 'KoreaTimeGood'; console.log(solution(str)); 느낀 점 보자마자 생각나는게 정규... » read more