Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleCutPrefix (0.3 sec)

  1. src/bytes/example_test.go

    	// Output:
    	// Cut("Gopher", "Go") = "", "pher", true
    	// Cut("Gopher", "ph") = "Go", "er", true
    	// Cut("Gopher", "er") = "Goph", "", true
    	// Cut("Gopher", "Badger") = "Gopher", "", false
    }
    
    func ExampleCutPrefix() {
    	show := func(s, sep string) {
    		after, found := bytes.CutPrefix([]byte(s), []byte(sep))
    		fmt.Printf("CutPrefix(%q, %q) = %q, %v\n", s, sep, after, found)
    	}
    	show("Gopher", "Go")
    	show("Gopher", "ph")
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
Back to top