Scala Goodness: RichString

Scala is a marvelous beast. Fire up the Scala shell and enter:

How can that be? "capitalize" is of type java.lang.String, and the Java class does not have a capitalize method. But the Scala RichString methods has (Scala 2.8 will use StringOps). And there are more methods to RichString, like reverse, drop, toDouble, toInt and toLong

Another nice one, is format. Not as nice as as GStrings in Groovy, but nevertheless:

How can Scala do this? There is a conversion going on in Scala, which automatically converts your Java String to RichString when the method cannot be found in String but in RichString. The relevant code is in Predef (look for yourself and see how deep the rabbit-hole goes):

Scala Glory!

189 thoughts on “Scala Goodness: RichString”

  1. Pingback: best
  2. Pingback: fucoxanthin
  3. Pingback: geniux pills
  4. Pingback: intelligex
  5. Pingback: intellux
  6. Pingback: probrain
  7. Pingback: radian-c
  8. Pingback: supreme antler
  9. Pingback: genius reviews
  10. Pingback: testomax
  11. Pingback: alpha f1
  12. Pingback: alpha fuel
  13. Pingback: alpha man pro
  14. Pingback: alpha peak
  15. Pingback: alpha xtrm
  16. Pingback: caralluma extract
  17. Pingback: anabolic rx24
  18. Pingback: garcinia melt
  19. Pingback: max synapse
  20. Pingback: nerventrax
  21. Pingback: premium cleanse
  22. Pingback: zynev
  23. Pingback: pro forskolin
  24. Pingback: forskolin slim
  25. Pingback: garcinia cleanse
  26. Pingback: garcinia xt
  27. Pingback: vitapulse
  28. Pingback: Vita pulse
  29. Pingback: vitapulse reviews
  30. Pingback: pure colon detox
  31. Pingback: pure colon detox
  32. Pingback: somnapure
  33. Pingback: perfect biotics
  34. Pingback: vitapulse scam
  35. Pingback: vitapulse
  36. Pingback: vita pulse
  37. Pingback: probiotic america
  38. Pingback: the bull
  39. Pingback: taurus traits
  40. Pingback: Fat Loss Factor
  41. Pingback: Diabetes Free pdf
  42. Pingback: Alexapure Pro
  43. Pingback: Ecomaxx
  44. Pingback: T90 Xplode Review
  45. Pingback: Maxtropin
  46. Pingback: Tea Tox Review
  47. Pingback: MegaDrox Reviews
  48. Pingback: Test X180 Reviews
  49. Pingback: Test X180 Reviews
  50. Pingback: vitapulse
  51. Pingback: probiotics america
  52. Pingback: Survival Md
  53. Pingback: Draft Dashboard
  54. Pingback: check my blog
  55. Pingback: Bonuses
  56. Pingback: imp source
  57. Pingback: navigate here
  58. Pingback: find more info
  59. Pingback: find this
  60. Pingback: Cash Blurbs Review
  61. Pingback: great post to read
  62. Pingback: browse this site
  63. Pingback: here
  64. Pingback: visit
  65. Pingback: dig this
  66. Pingback: see this here
  67. Pingback: directory
  68. Pingback: dig this
  69. Pingback: check it out
  70. Pingback: find more
  71. Pingback: read more
  72. Pingback: check it out
  73. Pingback: Bar Brothers
  74. Pingback: see this here
  75. Pingback: their explanation
  76. Pingback: find more
  77. Pingback: her latest blog
  78. Pingback: her latest blog
  79. Pingback: check it out
  80. Pingback: 0-6 Pack Abs
  81. Pingback: 60 day fix
  82. Pingback: click here
  83. Pingback: tires
  84. Pingback: rims
  85. Pingback: wheels
  86. Pingback: read more
  87. Pingback: click here
  88. Pingback: read more
  89. Pingback: click here

Comments are closed.