Resources
Answers
Examples
Log in
Create free account
What do you want to save?
Add Code snippet
New code examples in category Scala
Awgiedawgie
2022-02-22 14:40:10
scala length of string
var palindrome = "Dot saw I was Tod"; var len = palindrome.length();
Add solution
Awgiedawgie
2022-02-15 02:00:25
scala get file from url as string
import scala.io.Source val html = Source.fromURL("http://google.com") val s = html.mkString println(s)
Add solution
Awgiedawgie
2022-01-31 14:41:22
comments in scala
//Single line /* multiline comments */
Add solution
Phoenix Logan
2022-01-30 21:36:46
scala set contains all
val set = Set(1,2,3,4) val subset = Set(1,2) scala> subset.subsetOf(set) res0: Boolean = true scala> set.subsetOf(subset) res1: Boolean = false
Add solution
Awgiedawgie
2022-01-30 18:46:32
scala get the first element of a seq
Seq("1", "two", "3").head
Add solution
Gaurang Torvekar
2021-11-22 09:48:22
scala predicate
//A predicate is a function that returns a Boolean. //For example, to check if an Integer is even we can define the //function isEven. def isEven(i: Int) = i % 2 == 0 isEven: (i: Int)Boolean
Add solution
Carter
2021-11-19 21:09:21
scalar matrix
A matrix with equal-values across the diagonal. // scalar matrix: [ 0 1 2 2 0 1 3 2 0 ]
Add solution
Anupheaus
2021-11-16 08:19:22
scala read input
scala.io.StdIn.readLine()
Add solution
Royazamani
2021-11-15 07:42:25
scala jrtpath
Starting from JDK 13, compilation of some Scala classes that use third party libraries using macros behind the scenes causes the compiler to crash. Use JDK 11!
Add solution
Angela Perez
2021-11-10 11:13:04
scala iterator foreach
it foreach println
Add solution
‹
1
2
3
4
›
Best helpers
daily
weekly
monthly
for 3 months
Ranking is empty
This website uses cookies to make IQCode work for you. By using this site, you agree to our
cookie policy
Pleased to see you again
Sign up to unlock all of IQCode features:
Master useful skills
Improve learning outcomes
Share your knowledge
Sign in
E-mail
Password
Recover lost password
Log in
Or log in with
Not registered?
Sign up takes less than a minute
Create a Free Account
Sign up to unlock all of IQCode features:
Master useful skills
Improve learning outcomes
Share your knowledge
Sign up
Email
Password
Sign up for free
Or sign up with
By signing up, you agree to the
Terms and Conditions
and
Privacy Policy
. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.