I have found the cause of this particular problem. Apparently when processing strings on Macintosh,
\r is added in addition to any line breaks. Even though line break characters don't print out on a console, they're still inside the string.
The remedy was to do the following:
And now both strings match.
- Character Encoding interferes with matching Scala strings?
- Why does pattern matching in Scala not work with variables?
- Base 64 encoding with Scala or Java
- Scala pattern matching confusion with Option[Any]
- Matching function literals with quasiquotes in Scala
- What exactly did Scala improve with pattern matching in 2.10?
- Scala Pattern Matching with Sets
- Scala - pattern matching with conditional statements?
- Scala pattern matching with lowercase variable name
- Join strings with XML node between in scala
- Ignore None field while Encoding to json with Circe for Scala
- scala - using filter with pattern matching
- Does it make any sense to use pattern matching in Scala with really simple cases?
- Scala pattern matching with manifest
- Split strings with separator splited into each characters in Scala
- Problem with Scala matching + scope
- Comparing date strings with actual dates in Scala
- Optimize Scala pattern matching for Java enumeration with @switch
- Scala guarded pattern with or matching
- Scala pattern matching on generic type with TypeTag generates a warning while ClassTag not?
- Scala How to use pattern matching with a non generic LazyList?
- Pattern matching in Scala with case classes
- Scala declare multiple variables at the same row with the first character as upper-case
- Scala pattern matching option None with or without binding
- Scala Partially Applied Functions with Pattern Matching
- Identifying object fields with strings in Scala
- Scala Case class matching compile error with aliased inner types?
- scala pattern matching with regexp lookbehind operator
- Scala pattern matching with tuple: matching equal values in the tuple
- Why does this snippet with pattern matching and higher kinded types no longer compile in Scala 2.12?
More Query from same tag
- Scala Action Map Implementation Issue (follow up)
- ensimeConfig creates directories java and scala-2.11, which I don't need
- How to create a jar using SBT in Scala?
- Dealing with Options in Scala Play Template
- How to keep temporary output files in Spark
- Scala Blocking Map
- How to pass credentials to sbt build cli?
- Why is Scala 'match' stuck in a forever loop
- Akka flow Input (`In`) as Output (`Out`)
- Modifying free variable inside a closure in Scala
- Sbt credentials: java.lang.IllegalArgumentException: user must not be null
- How to concatenate the created resources in a list so I can delete them later in test as part of clean up?
- Pre-persistence validation for Scala case class using Salat/Casbah
- Scala secondary constructor argument visibility
- type-parametrized object in Scala
- How to output field padding in file Scala spark?
- How can I transform a Map to a case class in Scala?
- Scala: k fold cross validation
- Scala Data Type
- Creating an Oscillator Node in Scala.js using js.Dynamic
- How to find the largest element in a list of integers recursively?
- why adding a multi-line comment in the code makes it uncompilable
- Parameter value  did not match expected type [scala.Option (n/a)]
- Field "item" does not exist using Spark MLlib pipeline for ALS
- Scala REPL startup error "class file is broken"
- Issue resolving arity of function args to drive list processing, using Shapeless
- Deserializing case classes with Jerkson (nested)
- Spark count vs take and length
- Why does Spark Streaming application work fine using sbt run but does not on Tomcat (as web application)?
- SBT Project Publish to Maven Central