Created
April 23, 2020 16:00
-
-
Save wicky-andrian/a226bbf2411e207598649f4d781b9eec to your computer and use it in GitHub Desktop.
Contoh metode string part 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = "Java Ruby Java Ruby" | |
puts a | |
puts "Objek ID: #{a.object_id}" | |
b = a.sub("Java", "Python") | |
puts b | |
puts "Objek ID: #{b.object_id}" | |
c = a.sub!("Ruby","Kotlin") | |
puts c | |
puts "Objek ID: #{c.object_id}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment