Initial commit: Oraset programming language with documentation
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// 测试转义符
|
||||
|
||||
// 测试换行符
|
||||
show(`Line 1\nLine 2`);
|
||||
|
||||
// 测试制表符
|
||||
show(`Column 1\tColumn 2`);
|
||||
|
||||
// 测试回车符
|
||||
show(`Hello\rWorld`);
|
||||
|
||||
// 测试反斜杠
|
||||
show(`Path: C:\\Users\\Name`);
|
||||
|
||||
// 测试反引号
|
||||
show(`Backtick: \``);
|
||||
|
||||
// 测试未知转义符
|
||||
show(`Unknown escape: \x`);
|
||||
|
||||
// 测试转义符在字符串中的位置
|
||||
message = `This is a\nmulti-line\nstring`;
|
||||
show(message);
|
||||
|
||||
// 测试转义符与内置函数的结合
|
||||
length = len(`Hello\nWorld`);
|
||||
show(`Length of string with newline: `, length);
|
||||
Reference in New Issue
Block a user