04.4.1.md

This commit is contained in:
Unknown
2013-04-21 19:25:28 -04:00
parent 258c50e72a
commit d658c086ca
24 changed files with 447 additions and 18 deletions

View File

@@ -0,0 +1,14 @@
package main
import (
"fmt"
"strings"
)
func main() {
var str string = "This is an example of a string"
fmt.Printf("T/F? Does the string \"%s\" have prefix %s? ", str, "Th")
fmt.Printf("%t\n", strings.HasPrefix(str, "Th"))
}
// Output: T/F? Does the string "This is an example of a string" have prefix Th? true