diff --git a/subjects/iscapitalize/README.md b/subjects/iscapitalize/README.md index 91b9a839..751a6f9e 100644 --- a/subjects/iscapitalize/README.md +++ b/subjects/iscapitalize/README.md @@ -1,37 +1,42 @@ -## is-Capitalize +## iscapitalized -### Instructions +### Instructions -- Write a function `IsCapitalize` that takes a string and returns `true` if each word in the string begins with an uppercase letter, otherwise, and returns `false`. except for the word that begins with non-alphanumerical characters. -- If the string is empty, return `false`. +Write a function `IsCapitalized` that takes a `string` as an argument and returns `true` if each word in the `string` begins with either an uppercase letter or a non-alphabetic character. + +- If any of the words begin with a lowercase letter return `false`. +- If the `string` is empty return `false`. ### Expected function ```go -func IsCapitalize(s string) bool { +func IsCapitalized(s string) bool { } ``` ### Usage -Here is a possible program to test your function : +Here is a possible program to test your function: ```go package main import ( "fmt" + "piscine" ) func main() { - fmt.Println(IsAlpha("Hello! How are you?")) - fmt.Println(IsAlpha("Hello How Are You")) - fmt.Println(IsAlpha("Whats 4this 100K?")) - fmt.Println(IsAlpha("Whatsthis4")) + fmt.Println(piscine.IsCapitalized("Hello! How are you?")) + fmt.Println(piscine.IsCapitalized("Hello How Are You")) + fmt.Println(piscine.IsCapitalized("Whats 4this 100K?")) + fmt.Println(piscine.IsCapitalized("Whatsthis4")) + fmt.Println(piscine.IsCapitalized("!!!!Whatsthis4")) + fmt.Println(piscine.IsCapitalized("")) } ``` -And its output : +And its output: ```console $ go run . @@ -39,4 +44,6 @@ false true true true -``` \ No newline at end of file +true +false +```