如何在Swift中创建多行字符串? 这就是我试过的:
var myMultilineString = "This is a " + "\n" + "multiline string"
print(myMultilineString)
我想要打印:
这是
多行字符串
答案 0 :(得分:3)
Swift4内置了此功能:
#!/bin/bash
exec 3< "$2"
exec 4< "$3"
while read -ru3 -a a && read -ru4 -a b; do
[ "${a[$(($1 - 1))]}" != "${b[$(($1 - 1))]}" ] && exit 1
done
exit 0
非常方便
答案 1 :(得分:2)