More functions on strings #176
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: UlfNorell
Some suggestions
cc @thepiwo @radrow
Created by: radrow
May be also useful:
Created by: hanssv
Maybe
String.contains
, etc.Created by: maptuhec
Also useful:
Created by: maptuhec
String.to_bytes
?Created by: UlfNorell
What type would that have?
Created by: maptuhec
This was a suggestion from @hanssv for the following issue. The ecrecover returns. bytes, and if you want to compare it to a string it will not be possible for now(Bytes.to_str returns uppercase String) if the string is not passed in uppercase. So probably the type should be bytes. Just an issue that we have run into today.
Best,
Martin
Created by: UlfNorell
The problem is that
bytes
have fixed length and you don't know the length of the string at compile time.There could be a
Bytes.to_raw_string : bytes(n) => string
(or some better name) though, that gives you the bytes as they are without hex-encoding.I'm confused as to why you would have your address as an unencoded string though. It would contain lots of unprintable characters.
Created by: tolbrino
Something like
String.to_int(s : string) : int
would also be helpful.Created by: tolbrino
And
String.tokens(s : string, c : char) : list(string)
would split the string into tokens with the given character used as limiter.Created by: radrow
@tolbrino
String.to_int(s : string) : option(int)
, let's be safeCreated by: hanssv
Maybe even
String.to_int(s : string, base : int) : option(int)
?