('subscript(_:)' is unavailable: cannot subscript string with an int

·IOS
Swift에서 문자열 접근하기??let str = "Hello World!"print(str[4])이렇게 접근하면 아래의 에러를 출력하며 안된다.'subscript(_:)' is unavailable: cannot subscript String with an Int, use a String.Index instead.('subscript(_:)'를 사용할 수 없습니다. 문자열을 Int로 구독할 수 없으며 대신 String.Index를 사용하십시오.) int로 접근할 수 없으니 string.Index를 사용하라는 조언 해준다. 정말 답답하지만 다른 방법을 써야 한다. String.startIndex , String.index 활용하기let str = "Hello World!"let stringIndex = ..
퐁스팡스
'('subscript(_:)' is unavailable: cannot subscript string with an int' 태그의 글 목록