40 lines
833 B
Go
40 lines
833 B
Go
// Copyright © 2018 Inanc Gumus
|
|
// Learn Go Programming Course
|
|
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
//
|
|
// For more tutorials : https://learngoprogramming.com
|
|
// In-person training : https://www.linkedin.com/in/inancgumus/
|
|
// Follow me on twitter: https://twitter.com/inancgumus
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// ---------------------------------------------------------
|
|
// EXERCISE: Trim It
|
|
//
|
|
// 1. Look at the documentation of strings package
|
|
// 2. Find a function that trims the spaces from
|
|
// the given string
|
|
// 3. Trim the text variable and print it
|
|
//
|
|
// EXPECTED OUTPUT
|
|
// The weather looks good.
|
|
// I should go and play.
|
|
// ---------------------------------------------------------
|
|
|
|
func main() {
|
|
msg := `
|
|
|
|
The weather looks good.
|
|
I should go and play.
|
|
|
|
|
|
|
|
`
|
|
|
|
fmt.Println(msg)
|
|
}
|