Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift 5 get first character of string

Swift 5
let str = "abcdef"
print( String(str.characters.prefix(1)) ) // output: "a"
print( String(str.characters.prefix(3)) ) // output: "abc"
Comment

PREVIOUS NEXT
Code Example
Swift :: didSelectRowAt in table view 
Swift :: Swift Using insert() 
Swift :: swift image 
Swift :: remove all add TapGestureRecognizer swift 
Swift :: swiftui change form section color 
Swift :: navigationBarTitle text size swiftui 
Swift :: if else if and else statments in swift language 
Swift :: set font uilabel swift 
Swift :: declaring optionals swift 
Swift :: initialize array with zero in swift 
Swift :: Swift Markup in Xcode 11 
Swift :: swift extension Array where element 
Swift :: swift int to int32 
Swift :: swift subtract dates 
Swift :: send email swiftui 
Swift :: Optional & Default Parameter Swift 
Swift :: swift session.input 
Swift :: xcode how to get aspect ratio of device 
Swift :: swift print struct name 
Swift :: async await apis for ios 13 
Swift :: swift UIColor to String 
Swift :: 95 dollars in rupees 
Swift :: Swift Things to Remember About Swift Range 
Swift :: struct exsmple 
Swift :: how to unwrap arrays with optional value in swift 
Swift :: swift increment for loop by 2 
Swift :: Swift for Loop with Stride Function 
Ruby :: button with icon rails 
Ruby :: ruby refinement import dynamic methods 
Ruby :: how to add uniqueness in rails migration 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =