Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleReplace (0.17 sec)

  1. src/bytes/example_test.go

    	fmt.Println(bytes.NewReader([]byte("こんにちは!")).Len())
    	// Output:
    	// 3
    	// 16
    }
    
    func ExampleRepeat() {
    	fmt.Printf("ba%s", bytes.Repeat([]byte("na"), 2))
    	// Output: banana
    }
    
    func ExampleReplace() {
    	fmt.Printf("%s\n", bytes.Replace([]byte("oink oink oink"), []byte("k"), []byte("ky"), 2))
    	fmt.Printf("%s\n", bytes.Replace([]byte("oink oink oink"), []byte("oink"), []byte("moo"), -1))
    	// Output:
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
Back to top