๋ฌธ์์ด๊ฒ์2 ์๋ฐ์คํฌ๋ฆฝํธ : ๋ฌธ์์ด ๊ฒ์ ๋ฉ์๋ : charAt() ๋ฌธ์์ด ๊ฒ์ ๋ฉ์๋ : charAt() charAt() ๋ฉ์๋๋ ๋ฌธ์์ด์์ ํน์ ์ธ๋ฑ์ค์ ์์นํ๋ ๊ฐ์ ๋ฐํํฉ๋๋ค. charAt() ๋ฉ์๋ "๋ฌธ์์ด".charAt(์ซ์) const str1 = "javascript reference"; const currentStr1 = str1.charAt(); const currentStr2 = str1.charAt("0"); const currentStr3 = str1.charAt("1"); const currentStr4 = str1.charAt("2"); ๊ฒฐ๊ณผ๋ณด๊ธฐ j j a v 2022. 8. 22. ์๋ฐ์คํฌ๋ฆฝํธ : ๋ฌธ์์ด ๊ฒ์ ๋ฉ์๋ : match() ๋ฌธ์์ด ๊ฒ์ ๋ฉ์๋ : match() match() ๋ฉ์๋๋ ๋ฌธ์์ด(์ ๊ท์ ํฌํจ)์ ๊ฒ์ํ๊ณ , ๋ฐฐ์ด๋ก ๋ฐํํฉ๋๋ค. match() ๋ฉ์๋ 1. "๋ฌธ์์ด".match("๊ฒ์๊ฐ") const str1 = "javascript reference"; const currentStr1 = str1.match("javascript"); const currentStr2 = str1.match("reference"); const currentStr3 = str1.match("r"); ๊ฒฐ๊ณผ๋ณด๊ธฐ javascript reference r 2. "๋ฌธ์์ด".match(์ ๊ท์ ํํ) const str1 = "javascript reference"; const currentStr1 = str1.match(/reference/); co.. 2022. 8. 22. ์ด์ 1 ๋ค์ 728x90 ๋ฐ์ํ