728x90 ๋ฐ์ํ ๋ฌธ์์ด์ธ๋ฑ์ค1 [Swift] ๋ฌธ์์ด ๋ด๊ฐ ์ํ๋๋งํผ ์๋ฅด๊ธฐ ๋๋ง์ ๋จ์ด์ฅ ์ดํ์ ๋ง๋๋๋ฐ ๋ด๊ฐ ํ๋ฆฐ ๋จ์ด๋ฅผ ๋ชจ์ผ๋ ๋ฐฐ์ด์ ๋ง๋๋๋ฐ ๋จ์ด ํ ์คํธ๊ฐ ์๋์ ๊ฐ์ด 1. Business ์ด๋ ๊ฒ 1๊ณผ .์ด ์์ฌ์์ด ์ด๊ฑฐ ๋นผ๊ณ ๋จ์ด ๊ทธ ์์ฒด๋ง ๋ฐ์์ฌ ์ ์์๊น๋ฅผ ์๊ฐํ๋ค๊ฐ (1.)์ ์๋ฅด๋ฉด ๋๊ฒ ๋ค๋ผ๊ณ ์๊ฐํ๋ค. ์๋ฅด๋ ๋ฐฉ๋ฒ์ ์ํ๋ ๋ฌธ์์ด์์ ์ฒ์ ์ธ๋ฑ์ค๋ฅผ ์์๋ด๊ณ ๋ช๋ฒ์งธ๊น์ง ์๋ผ์ฃผ๋ผ ํ๋ฉด๋๋ค. ๋ฐฉ๋ฒ์ ์๋์ ๊ฐ์ด .index(๋ฌธ์์ด์ ์์ ์ธ๋ฑ์ค,์ด๋๊น์ง ์๋ผ์ผํ ์ง ์ธ๋ฑ์ค)๋ฅผ ์ฐ๋ฉด๋๋ค. let str = "1.asd" let startIdx:String.Index = str.index(str.startIndex, offsetBy: 2) print("\(str[startIdx...])") //asd๋ฅผ ์ถ๋ ฅ ์๋๋ ์ ์ฉ๊ฒฐ๊ณผ +๋ณด๋์ค let str = "1.asd" let f.. 2020. 1. 19. ์ด์ 1 ๋ค์ 728x90 ๋ฐ์ํ