Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active April 2, 2023 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacr/c1eee4f6735f456671f28fadbcbaefba to your computer and use it in GitHub Desktop.
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/39bd0126b48109ba256b20762f7383e1853fe3db
// summary : implicit class scala feature.
// keywords : scala, language-feature, implicit-class, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// 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.1.1"
// ---------------------
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