Created
May 11, 2024 02:08
-
-
Save filipearray/b618d39ae156b287b3c8b137321e3943 to your computer and use it in GitHub Desktop.
Welcome To Tech Palace!
This file contains 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
package techpalace | |
import "strings" | |
// WelcomeMessage returns a welcome message for the customer. | |
func WelcomeMessage(customer string) string { | |
return "Welcome to the Tech Palace, " + strings.ToUpper(customer) | |
panic("Please implement the WelcomeMessage() function") | |
} | |
// AddBorder adds a border to a welcome message. | |
func AddBorder(welcomeMsg string, numStarsPerLine int) string { | |
return strings.Repeat("*", numStarsPerLine)+ "\n" + welcomeMsg + "\n" + strings.Repeat("*", numStarsPerLine) | |
panic("Please implement the AddBorder() function") | |
} | |
// CleanupMessage cleans up an old marketing message. | |
func CleanupMessage(oldMsg string) string { | |
strWithoutStars := strings.Replace(oldMsg, "**************************\n*", "", -1) | |
strWithoutStars = strings.Replace(strWithoutStars, "*", "", -1) | |
strWithoutStars = strings.Replace(strWithoutStars, "\n**************************", "", -1) | |
strWithoutStars = strings.TrimSpace(strWithoutStars) | |
return strWithoutStars | |
panic("Please implement the CleanupMessage() function") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment