This commit is contained in:
wagslane
2023-05-01 15:25:27 -06:00
parent f8912668b8
commit 9be3074de6
868 changed files with 58698 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
package main
import (
"fmt"
"strings"
)
func removeProfanity(message *string) {
messageVal := *message
messageVal = strings.ReplaceAll(messageVal, "dang", "****")
messageVal = strings.ReplaceAll(messageVal, "shoot", "*****")
messageVal = strings.ReplaceAll(messageVal, "heck", "****")
*message = messageVal
}
// don't touch below this line
func test(messages []string) {
for _, message := range messages {
removeProfanity(&message)
fmt.Println(message)
}
}
func main() {
messages1 := []string{
"well shoot, this is awful",
"dang robots",
"dang them to heck",
}
messages2 := []string{
"well shoot",
"Allan is going straight to heck",
"dang... that's a tough break",
}
test(messages1)
test(messages2)
}