From 7a4f2e73addf6dfcde2a6b17b62b961608e556a0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 9 Nov 2024 15:11:11 -0500 Subject: Rename `from_text()` to `parse()` --- docs/integers.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/integers.md') diff --git a/docs/integers.md b/docs/integers.md index 16728c44..f5e6838b 100644 --- a/docs/integers.md +++ b/docs/integers.md @@ -154,14 +154,14 @@ The octal string representation of the integer. --- -## `from_text` +## `parse` **Description:** Converts a text representation of an integer into an integer. **Signature:** ```tomo -func from_text(text: Text -> Int?) +func parse(text: Text -> Int?) ``` **Parameters:** @@ -175,17 +175,17 @@ a null value will be returned. **Example:** ```tomo ->> Int.from_text("123") +>> Int.parse("123") = 123? ->> Int.from_text("0xFF") +>> Int.parse("0xFF") = 255? # Can't parse: ->> Int.from_text("asdf") +>> Int.parse("asdf") = !Int # Outside valid range: ->> Int8.from_text("9999999") +>> Int8.parse("9999999") = !Int ``` -- cgit v1.2.3