Scala seems to transform objects of type String to StringOps. How is this done? I.e. how and when does Scala transform an object of String to StringOps?
There is an implicit conversion defined from String to StringOps in Predef.scala. https://github.com/scala/scala/blob/a24ca7fa617cabada82c43d2d6ac354db698d181/src/library/scala/Predef.scala#L308. This converts a String instance to a StringOps instance if you call method from StringOps class on a String.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With