fix: coding style and file format for chapter 7.

This commit is contained in:
Bo-Yi Wu
2017-02-11 12:26:05 +08:00
parent d9041c7fc3
commit e6d601d3a1
15 changed files with 375 additions and 375 deletions

View File

@@ -1,16 +1,16 @@
package main
import "fmt"
func main() {
str := "Google"
for i:=0; i <= len(str); i++ {
a, b := Split(str, i)
fmt.Printf("The string %s split at position %d is: %s / %s\n", str, i, a, b)
}
}
func Split(s string, pos int) (string, string) {
return s[0:pos], s[pos:]
}
package main
import "fmt"
func main() {
str := "Google"
for i := 0; i <= len(str); i++ {
a, b := Split(str, i)
fmt.Printf("The string %s split at position %d is: %s / %s\n", str, i, a, b)
}
}
func Split(s string, pos int) (string, string) {
return s[0:pos], s[pos:]
}