public/subjects/stringtobool
miguel 4974a86b84 docs(checkpoints-exercises): remove piscine imports 2023-07-04 15:43:17 +01:00
..
README.md docs(checkpoints-exercises): remove piscine imports 2023-07-04 15:43:17 +01:00

README.md

stringtobool

Instructions

Write a function that takes a string as an argument and returns a boolean.

  • If the string equals True, T or t return true, otherwise return false.

Expected function

func StringToBool(s string) bool {

}

Usage

Here is a possible program to test your function:

package main

import (
	"fmt"
)

func main() {
	fmt.Println(StringToBool("True"))
	fmt.Println(StringToBool("T"))
	fmt.Println(StringToBool("False"))
	fmt.Println(StringToBool("TTFF"))
}

And its output:

$ go run .
true
true
false
false