๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ฌธ์ž์—ด๊ฒ€์ƒ‰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.
728x90
๋ฐ˜์‘ํ˜•
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๐Ÿฆ™

CSS
๊ด‘๊ณ  ์ค€๋น„์ค‘