Say I have a string here: 说我在这里有一个字符串: 数组
var fullName: String = "First Last"
I want to split the string base on white space and assign the values to their respective variables 我想在空白处分割字符串并将值分配给它们各自的变量 spa
var fullNameArr = // something like: fullName.explode(" ") var firstName: String = fullNameArr[0] var lastName: String? = fullnameArr[1]
Also, sometimes users might not have a last name. 一样,有时用户可能没有姓氏。 .net