[TypeScript] 문자열 배열을 숫자 배열로 변환 방법, split()
let beforeArray = "1, 2, 3, 4"Debug.Log(beforeArray)// ["1", "2", "3", "4"] [기대 결과] Debug.Log(beforeArray)// [1, 2, 3, 4] [해결]let beforeArray = "1, 2, 3, 4"let afterArray = beforeArray.split(",").map(Number);Debug.Log(beforeArray)// [1, 2, 3, 4] 참고https://stackoverflow.com/questions/15677869/how-to-convert-a-string-of-numbers-to-an-array-of-numbers