字元串定義
使用單引号或雙引号
String a = “abcdefg”;
String b = ‘12345’;
建立多行字元串,保留内在格式
使用三個單引号或三個雙引号 建立多行字元串,保留内在格式,如換行和縮進等,裡面寫什麼輸出就是什麼。
三個單引号
String e = ‘’'asd
fdsd
fff
三個雙引号
String f = “”" 1
2
3
4
“”";
字元串定義
使用單引号或雙引号
String a = “abcdefg”;
String b = ‘12345’;
建立多行字元串,保留内在格式
使用三個單引号或三個雙引号 建立多行字元串,保留内在格式,如換行和縮進等,裡面寫什麼輸出就是什麼。
三個單引号
String e = ‘’'asd
fdsd
fff
三個雙引号
String f = “”" 1
2
3
4
“”";