Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift substring

func sliceString(str: String, start: Int, end: Int) -> String {
    let data = Array(str)
    return String(data[start..<end])
}

print(sliceString(str: "0123456789", start: 0, end: 3)) // -> prints 012
Comment

PREVIOUS NEXT
Code Example
Swift :: rtl ios swift 
Swift :: how to get the last element of an array in swift 
Swift :: how to get rid of excess space in swift 
Swift :: Return multiple value of different data types swift 
Swift :: swiftui vstack alignment 
Swift :: button in swiftui 
Swift :: how to make box shadow swift 
Swift :: how to disable uitableview scrolling in swift 
Swift :: replace character in swift 
Swift :: post API Call in swift 
Swift :: swift setinterval 
Swift :: swift ui enum 
Swift :: uiimageview set image swift 
Swift :: string to json swift 
Swift :: swift add programmatically width height constraint to view 
Swift :: swift arrays 
Swift :: Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. 
Swift :: swift get current hour 
Swift :: swift iterate through string 
Swift :: swift dictionary sorted 
Swift :: how to set return type swift 
Swift :: swiftui text editor 
Swift :: swift lazy 
Swift :: swiftui selection list 
Swift :: swift sf symbol uiimage size 
Swift :: Logical Operators Swift 
Swift :: how to darken view swiftui 
Swift :: cherries 
Swift :: Declare Constants in Swift 
Swift :: Notification Service Extension vs Content Extension 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =