Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 25, 2024 10:19
Show Gist options
  • 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/1bfa3cf5e6841fff234a03770a7d5e045a154426
// 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.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