slice (string)

This commit is contained in:
Andrew Morris
2023-03-15 09:21:58 +11:00
parent a9e52e564f
commit 48314c692d
4 changed files with 93 additions and 31 deletions

View File

@@ -0,0 +1,21 @@
// test_output! ["","","","🎨","🎨","🎨","한🎨","한🎨","🍹abc£한","🚀🍹abc£한🎨","🚀🍹abc£한🎨","🚀🍹abc£한🎨",""]
export default function () {
const str = "🚀🍹abc£한🎨";
return [
str.slice(-1),
str.slice(-2),
str.slice(-3),
str.slice(-4),
str.slice(-5),
str.slice(-6),
str.slice(-7),
str.slice(-8),
str.slice(1, -1),
str.slice(),
str.slice(0, 100),
str.slice(0, 20),
str.slice(10, -11),
];
}