Created
January 22, 2018 10:12
-
-
Save sergiilagutin/8f85c64b261d527253e77cdeb4e8e5dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val str = "first string" | |
val field = classOf[String].getDeclaredField("value") | |
field.setAccessible(true) | |
val value = field.get(str).asInstanceOf[Array[Char]] | |
value(0) = 'W' | |
value(1) = 'o' | |
str // "Worst string" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment