From 8019a5ceaa6e838be04e8cdd82ec30d137e2eec8 Mon Sep 17 00:00:00 2001 From: ZigBalthazar Date: Mon, 8 Jul 2024 19:59:57 +0330 Subject: [PATCH] revert string utils --- .../tokens/jetton/{basic => }/master.tact | 0 .../tokens/jetton/{basic => }/wallet.tact | 0 contracts/traits/utils/string.tact | 68 ------------------- wrappers/stringutil.ts | 9 --- 4 files changed, 77 deletions(-) rename contracts/traits/tokens/jetton/{basic => }/master.tact (100%) rename contracts/traits/tokens/jetton/{basic => }/wallet.tact (100%) delete mode 100644 contracts/traits/utils/string.tact delete mode 100644 wrappers/stringutil.ts diff --git a/contracts/traits/tokens/jetton/basic/master.tact b/contracts/traits/tokens/jetton/master.tact similarity index 100% rename from contracts/traits/tokens/jetton/basic/master.tact rename to contracts/traits/tokens/jetton/master.tact diff --git a/contracts/traits/tokens/jetton/basic/wallet.tact b/contracts/traits/tokens/jetton/wallet.tact similarity index 100% rename from contracts/traits/tokens/jetton/basic/wallet.tact rename to contracts/traits/tokens/jetton/wallet.tact diff --git a/contracts/traits/utils/string.tact b/contracts/traits/utils/string.tact deleted file mode 100644 index 08d1474..0000000 --- a/contracts/traits/utils/string.tact +++ /dev/null @@ -1,68 +0,0 @@ -// String module with String Comparison, Trimming, Padding, and other string operations - -// Function to concatenate two strings -fun concatenate(str1: String, str2: String): String { - return str1 ++ str2; -} - -// Function to extract a substring -fun substring(str: String, start: Int, length: Int): String { - return str.sub(start, length); -} - -// Function to get the length of a string -fun length(str: String): Int { - return str.len(); -} - -// Function to compare two strings lexicographically -fun compare(str1: String, str2: String): Int { - if (str1 == str2) { - return 0; - } else if (str1 < str2) { - return -1; - } else { - return 1; - } -} - -// Function to convert an integer to a string -fun intToString(num: Int): String { - return num.toStr(); -} - -// Function to access a character in a string at a specific index -fun charAt(str: String, index: Int): String { - require(index >= 0 && index < str.len(), "Index out of bounds"); - return str.sub(index, 1); -} - -// Function to check if a string contains a specific substring using regular expressions -fun contains(str: String, pattern: String): Bool { - let regex = pattern.toRegexp(); - return regex.match(str) != null; -} - -// Function to trim whitespace from the beginning and end of a string -fun trim(str: String): String { - return str.trim(); -} - -// Function to pad a string with specified characters on the left -fun padLeft(str: String, length: Int, char: String): String { - let diff = length - str.len(); - if (diff <= 0) { - return str; - } - return char.repeat(diff) ++ str; -} - -// Function to pad a string with specified characters on the right -fun padRight(str: String, length: Int, char: String): String { - let diff = length - str.len(); - if (diff <= 0) { - return str; - } - return str ++ char.repeat(diff); -} - diff --git a/wrappers/stringutil.ts b/wrappers/stringutil.ts deleted file mode 100644 index 9cba073..0000000 --- a/wrappers/stringutil.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CompilerConfig } from '@ton/blueprint'; - -export const compile: CompilerConfig = { - lang: 'tact', - target: 'contracts\traits\string.tact', - options: { - debug: true, - }, -};