์•Œ๊ณ ๋ฆฌ์ฆ˜(programmers)

[Swift] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค_ํ‘ธ๋“œํŒŒ์ดํ„ฐ

yeggrrr๐Ÿผ 2024. 3. 14. 10:56

<๋ฌธ์ œ>


<๋‚ด ํ’€์ด>


ํ‘ธ๋“œํŒŒ์ดํ„ฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ ํ’€์ด๋ฅผ ํ•˜๋ฉด์„œ
Array ๊ธฐ๋Šฅ๊ณผ joined์— ๋Œ€ํ•ด์„œ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์—ˆ๋‹ค. 

โœ”๏ธinit(repeating:count:) ํŠน์ • ๊ฐ’์„ ๋ฐ˜๋ณต โœ”๏ธ

(repeating → ๋ฐ˜๋ณตํ•  ๋ฌธ์ž, ๋ฌธ์ž์—ด, ์ˆซ์ž, bool  /  count → ๋ฐ˜๋ณตํ•  ํšŸ์ˆ˜)

โœ”๏ธjoined( ) → ๋ฐฐ์—ด ์† ์›์†Œ๋“ค์„ ํ•˜๋‚˜๋กœ ๋ฌถ์„๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ฉ”์†Œ๋“œโœ”๏ธ

https://developer.apple.com/documentation/swift/array/joined()

 

joined() | Apple Developer Documentation

Returns the elements of this sequence of sequences, concatenated.

developer.apple.com

โœ”๏ธjoined(separator:) ํŠน์ • ์š”์†Œ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ฌถ๋Š” ๋ฐฉ๋ฒ•โœ”๏ธ

https://developer.apple.com/documentation/swift/array/joined(separator:)-7uber

 

joined(separator:) | Apple Developer Documentation

Returns the concatenated elements of this sequence of sequences, inserting the given separator between each element.

developer.apple.com




728x90