Skip to content

Commit

Permalink
complexities
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif committed Dec 4, 2024
1 parent b8e83a0 commit 19780e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Text.mo
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ module {
/// ```motoko include=import
/// let text = Text.fromArray(['A', 'v', 'o', 'c', 'a', 'd', 'o']); // "Avocado"
/// ```
///
/// Runtime: O(a.size())
/// Space: O(a.size())
public func fromArray(a : [Char]) : Text = fromIter(a.vals());

/// Converts the given `[var Char]` to a `Text` value.
///
/// ```motoko include=import
/// let text = Text.fromVarArray([var 'E', 'g', 'g', 'p', 'l', 'a', 'n', 't']); // "Eggplant"
/// ```
///
/// Runtime: O(a.size())
/// Space: O(a.size())
public func fromVarArray(a : [var Char]) : Text = fromIter(a.vals());

/// Iterates over each `Char` value in the given `Text`.
Expand Down

0 comments on commit 19780e6

Please sign in to comment.