Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for TrimRight (0.26 sec)

  1. src/bytes/example_test.go

    	b = bytes.TrimSuffix(b, []byte("gopher"))
    	b = append(b, bytes.TrimSuffix([]byte("world!"), []byte("x!"))...)
    	os.Stdout.Write(b)
    	// Output: Hello, world!
    }
    
    func ExampleTrimRight() {
    	fmt.Print(string(bytes.TrimRight([]byte("453gopher8257"), "0123456789")))
    	// Output:
    	// 453gopher
    }
    
    func ExampleTrimRightFunc() {
    	fmt.Println(string(bytes.TrimRightFunc([]byte("go-gopher"), unicode.IsLetter)))
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  2. src/archive/tar/reader.go

    	// nextToken gets the next token delimited by a newline. This assumes that
    	// at least one newline exists in the buffer.
    	nextToken := func() string {
    		cntNewline--
    		tok, _ := buf.ReadString('\n')
    		return strings.TrimRight(tok, "\n")
    	}
    
    	// Parse for the number of entries.
    	// Use integer overflow resistant math to check this.
    	if err := feedTokens(1); err != nil {
    		return nil, err
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  3. src/bytes/bytes.go

    		}
    		s = s[n:]
    	}
    	if len(s) == 0 {
    		// This is what we've historically done.
    		return nil
    	}
    	return s
    }
    
    // TrimRight returns a subslice of s by slicing off all trailing
    // UTF-8-encoded code points that are contained in cutset.
    func TrimRight(s []byte, cutset string) []byte {
    	if len(s) == 0 || cutset == "" {
    		return s
    	}
    	if len(cutset) == 1 && cutset[0] < utf8.RuneSelf {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  4. src/archive/tar/writer.go

    	tw.blk.reset()
    
    	// Best effort for the filename.
    	name = toASCII(name)
    	if len(name) > nameSize {
    		name = name[:nameSize]
    	}
    	name = strings.TrimRight(name, "/")
    
    	var f formatter
    	v7 := tw.blk.toV7()
    	v7.typeFlag()[0] = flag
    	f.formatString(v7.name(), name)
    	f.formatOctal(v7.mode(), 0)
    	f.formatOctal(v7.uid(), 0)
    	f.formatOctal(v7.gid(), 0)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
Back to top