G2A Many GEOs
SHARE
TWEET

Activity2_matan

a guest Apr 9th, 2020 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "os"
  6.     s "strings"
  7. )
  8.  
  9. func main() {
  10.     var input_str string
  11.  
  12.     fmt.Printf("Enter a string: ")
  13.     _, err := fmt.Scanf("%s", &input_str)
  14.     if err != nil {
  15.         fmt.Println(err)
  16.         os.Exit(1)
  17.     }
  18.  
  19.     input_str = s.ToLower(input_str)
  20.     if s.HasPrefix(input_str, "i") &&
  21.         s.HasSuffix(input_str, "n") &&
  22.         s.Contains(input_str, "a") {
  23.         fmt.Println("Found!")
  24.     } else {
  25.         fmt.Println("Not Found!")
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top