aboutsummaryrefslogtreecommitdiff
path: root/builtins/text.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-20 15:27:42 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-20 15:27:42 -0400
commitc5c3be9e5d74cda08df2c36412e0a652f1433d4f (patch)
tree3ae54a8180a47cd66361bf25773b45cd5b2dd3e1 /builtins/text.c
parent5b1960859fcc6331a486ced98c5f25d93168fa18 (diff)
Deprecate Text.slice()
Diffstat (limited to 'builtins/text.c')
-rw-r--r--builtins/text.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/builtins/text.c b/builtins/text.c
index a3161926..e8c476a3 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -128,21 +128,6 @@ public uint32_t Text$hash(const CORD *cord)
return hash;
}
-public CORD Text$slice(CORD text, int64_t first, int64_t length)
-{
- if (length == 0) return CORD_EMPTY;
- int64_t len = CORD_len(text);
-
- if (length < -len) return CORD_EMPTY;
-
- if (first <= 0) first = len + first + 1;
- if (first < 1) first = 1;
- else if (first > len + 1) first = len + 1;
-
- if (length < 0) length = len + length;
- return CORD_substr(text, first - 1, length);
-}
-
public CORD Text$upper(CORD str)
{
if (!str) return str;