Login
|
Signup
langref.org
-
scala
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
ruby
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Regex
Replacing
Replace the first regex match in a string with a static string
Transform
"Red Green Blue"
into
"R*d Green Blue"
by replacing
/e/
with
"*"
scala
val replaced = "Red Green Blue".replaceFirst("e", "*")
object SolutionXX extends Application {
val replaced = "Red Green Blue".replaceFirst("e", "*")
println(replaced)
}
Submit a new solution for
scala
There are 14 other solutions in
additional
languages (
clojure
,
cpp
,
erlang
,
fantom
...)