What is Nostr?
SUPERMAX
npub14cg…qjhl
2024-12-27 03:24:41
in reply to nevent1q…2srz

SUPERMAX on Nostr: Ehh you shouldn't need to Why not use an index instead of counting characters? Or ...

Ehh you shouldn't need to

Why not use an index instead of counting characters? Or return the index of the failure?

Using '&str' could be useful for easier comparisons too

or even if you have some real complex parsing logic , using a state structure could be useful. Could even create a struct to encapsulate the parser state, including the current index and other info
Author Public Key
npub14cgq353exzmhdsvqjtmw4dq7fvyleuls8umyrvd5umhr4gtx6asq7hqjhl