A를 #으로

WooBuntu·2021년 2월 16일
0

JS 90제

목록 보기
2/33
  • 정규표현식
const solution = string => string.replace(/A/g, '#');

const result = solution('BANANA');
console.log(result);
  • 일반 문자열
const solution = string => string.split('A').join('#');

const result = solution('BANANA');
console.log(result);

0개의 댓글