본문 바로가기 메뉴 바로가기

ZeddiOS

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

ZeddiOS

검색하기 폼
  • 전체 보기 (841)
    • iOS (278)
    • Swift (126)
      • Concurrency (9)
    • SwiftUI (26)
    • Combine (17)
    • watchOS (2)
    • iPadOS (2)
    • Xcode (3)
      • Xcode Cloud (2)
    • Flutter (12)
    • 공부 (205)
    • 피아노 (39)
    • 요리 (2)
    • 시 (25)
    • 일상 (91)
  • 방명록

swift string to array (1)
Swift3 ) How to convert string to an array in Swift ( 문자열을 배열로 바꾸는 방법)

안녕하세요 :) 오늘은 문자열을 배열로 바꾸는 방법을 알려드리고자 합니다.간단해요! 1. Array로 타입변환import Foundationlet str = "hello, zedd"let arr = Array(str.characters)print(arr)//["h", "e", "l", "l", "o", ",", " ", "z", "e", "d", "d"] 2. map 사용 import Foundationlet str = "hello, zedd"let arr = str.characters.map {String($0)}print(arr)//["h", "e", "l", "l", "o", ",", " ", "z", "e", "d", "d"] 사실 str 그 자체가 문자열이기때문에 import Foundation..

Swift 2017. 7. 10. 22:29
이전 1 다음
이전 다음
TAG
  • actor
  • swift tutorial
  • swift3
  • np-hard
  • iOS delegate
  • 피아노
  • 회고
  • ios 13
  • Swift
  • swift sort
  • 제이슨 파싱
  • swift delegate
  • github
  • UIBezierPath
  • Git
  • 스위프트
  • WKWebView
  • Combine
  • 스위프트 문법
  • Accessibility
  • swift 공부
  • swift array
  • WWDC
  • IOS
  • np-complete
  • WidgetKit
  • FLUTTER
  • SwiftUI
  • Xcode
  • fastlane
more
글 보관함
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바