Skip to content

looking for string->float function and how to get a word array from a string #1226

Answered by CosmicToast
fnaj77 asked this question in Q&A
Discussion options

You must be logged in to vote
  1. scan-number works
  2. use a peg, you don't even need to do post-processing.
# translation: skip whitespace (if any),
# then capture required non-whitespace characters,
# followed by any amount of whitespace characters,
# an unlimited amount of times
(def splitter '(* (any :s) (any (* '(some :S) (any :s)))))
(peg/match splitter "  ab   cd ") # => @["ab" "cd"]
  1. Janet for mortals is about as good as you're going to get. I've been thinking of writing something too, but given my current situation that's not happening until at least next year.

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@fnaj77
Comment options

Answer selected by fnaj77
Comment options

You must be logged in to vote
1 reply
@fnaj77
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants