Ellen Spertus
03/02/2020, 10:34 PMs.replace("\\s+", "")
Dominaezzz
03/02/2020, 11:18 PMEllen Spertus
03/02/2020, 11:19 PMString.replace()
with a regular expression a lot, although usually I use a pre-compiled pattern for efficiency. Do you see the bug in my code?Shawn
03/02/2020, 11:23 PM.toRegex()
or Regex()
call means you’re using .replace(String, String)
instead of .replace(Regex, String)
, the former of which iirc is just a simple search and replaceEllen Spertus
03/02/2020, 11:24 PMs.replace(Regex("\\s+"), "")
LeoColman
03/03/2020, 3:17 PMs.replace("\\s+".toRegex(), "")
LeoColman
03/03/2020, 3:17 PMLeoColman
03/03/2020, 3:17 PMEllen Spertus
03/03/2020, 5:52 PM