Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:23
Show Gist options
  • Select an option

  • Save dacr/c1eee4f6735f456671f28fadbcbaefba to your computer and use it in GitHub Desktop.

Select an option

Save dacr/c1eee4f6735f456671f28fadbcbaefba to your computer and use it in GitHub Desktop.
implicit class scala feature. / published by https://github.com/dacr/code-examples-manager #7c2fd589-a63b-4d76-bdf6-90c812f99335/c078f374bc3be07536e6f2c36a5207fdbb2cfce
// summary : implicit class scala feature.
// keywords : scala, language-feature, implicit-class, @testable
// publish : gist
// authors : David Crosson
// license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
// id : 7c2fd589-a63b-4d76-bdf6-90c812f99335
// created-on : 2020-05-31T19:54:52Z
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// ---------------------
//> using scala "3.4.2"
// ---------------------
implicit class SuperRichString(in:String) { def truc = in.size/2}
println("hello".truc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment