Swift:
let string = “123456”
let firstStr = string.first//“1”
OC:
NSString *string = @“123456”
NSString* firstStr = [string substringToIndex:1];// “1”
Swift:
let string = “123456”
let firstStr = string.first//“1”
OC:
NSString *string = @“123456”
NSString* firstStr = [string substringToIndex:1];// “1”
本文标题:iOS 获取第一个字符串
本文链接:https://www.haomeiwen.com/subject/fhghqftx.html
网友评论