updated bookmarks in chrome
This commit is contained in:
parent
44bc223d18
commit
a4cc005559
|
|
@ -1,5 +1,6 @@
|
|||
package main
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
import "fmt"
|
||||
|
||||
func ending(start, end string) bool {
|
||||
|
|
@ -16,4 +17,29 @@ func ending(start, end string) bool {
|
|||
func main() {
|
||||
ending("abc","bc")
|
||||
ending("abc","d")
|
||||
=======
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
func ToCamelCase(s string) string {
|
||||
// your code
|
||||
dash := "-"
|
||||
// und := "_"
|
||||
if strings.Contains(s,dash) {
|
||||
fmt.Println("Contains dashes!")
|
||||
index := strings.Index(s,dash)
|
||||
fmt.Println(index)
|
||||
fmt.Println(strings.ReplaceAll(s,string(s[index:index]),strings.ToUpper(string(s[index+1]))))
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func main() {
|
||||
ToCamelCase("the-stealth-warrior")
|
||||
// ToCamelCase("The_Stealth_Warrior")
|
||||
// ToCamelCase("The_Stealth-Warrior")
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
|
|
|
|||
9
codewars/task.txt
Normal file
9
codewars/task.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the original word was capitalized (known as Upper Camel Case, also often referred to as Pascal case). The next words should be always capitalized.
|
||||
|
||||
Examples
|
||||
"the-stealth-warrior" gets converted to "theStealthWarrior"
|
||||
|
||||
"The_Stealth_Warrior" gets converted to "TheStealthWarrior"
|
||||
|
||||
"The_Stealth-Warrior" gets converted to "TheStealthWarrior"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user