lfglabs-dev / api.starknet.quest

starknet.quest rust backend
2 stars 17 forks source link

Parse string utils function #264 #271

Open jsanchez556 opened 8 hours ago

jsanchez556 commented 8 hours ago

The new function parse_string replaces placeholders in a string with a given address in hexadecimal and decimal formats.

Input: A string (input) with placeholders {addr_hex} and {addr_dec} and a FieldElement (address). Output: A new string with placeholders replaced by the address in hex and decimal formats. Usage: let result = parse_string("Your address: {addr_hex}, {addr_dec}.", address);