提交 46b5cc3d 编写于 作者: lizhongyi_'s avatar lizhongyi_

补充 sting.substring示例

上级 40ec3a6f
...@@ -275,6 +275,9 @@ export function testString(): Result { ...@@ -275,6 +275,9 @@ export function testString(): Result {
expect(str2.substring(3, 8)).toEqual("lo wo"); expect(str2.substring(3, 8)).toEqual("lo wo");
expect(str2.substring(0, -1)).toEqual(""); expect(str2.substring(0, -1)).toEqual("");
expect(str2.substring(0, 20)).toEqual("hello world"); expect(str2.substring(0, 20)).toEqual("hello world");
var str3 = "aaa";
expect(str3.substring(10, 1)).toEqual("aa");
}) })
test("trim", () => { test("trim", () => {
const greeting = ' Hello world! '; const greeting = ' Hello world! ';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册