Scanner:Swift中的StringInterpolationConvertible样式scanf

时间:2021-04-30 19:37:07
【文件属性】:
文件名称:Scanner:Swift中的StringInterpolationConvertible样式scanf
文件大小:867KB
文件格式:ZIP
更新时间:2021-04-30 19:37:07
HTML 扫描器 记住在C语言中您必须使用printf -太糟糕了! int x = 5 ; printf ( " The number is %i " , x); // -> The number is 5 但是随后Swift凭借超漂亮的字符串插值技术得以营救! let x = 5 print ( " The number is \( x ) " ) // -> The number is 5 Swift可以再次从令人讨厌的scanf拯救我们吗? char *name int age; scanf ( " %s %i " , name, &age); 完全正确! let name = Scannable < String> () let age = Scannable < Int> () scan ( " \( name ) \( age ) " ) AM! 就这么简单! 如果

网友评论