Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for RuneCount (0.05 sec)

  1. istioctl/pkg/writer/table/writer.go

    	for _, row := range output {
    		for i, col := range row {
    			_, _ = fmt.Fprint(c.writer, col.String())
    			if i == len(row)-1 {
    				_, _ = fmt.Fprint(c.writer, "\n")
    			} else {
    				padAmount := sep[i] - utf8.RuneCount([]byte(col.Value)) + 2
    				_, _ = fmt.Fprint(c.writer, strings.Repeat(" ", padAmount))
    			}
    		}
    	}
    }
    
    func getMaxWidths(output [][]Cell) []int {
    	widths := make([]int, len(output[0]))
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Nov 06 09:43:25 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  2. src/bytes/bytes.go

    // If sep is an empty slice, Count returns 1 + the number of UTF-8-encoded code points in s.
    func Count(s, sep []byte) int {
    	// special case
    	if len(sep) == 0 {
    		return utf8.RuneCount(s) + 1
    	}
    	if len(sep) == 1 {
    		return bytealg.Count(s, sep[0])
    	}
    	n := 0
    	for {
    		i := Index(s, sep)
    		if i == -1 {
    			return n
    		}
    		n++
    		s = s[i+len(sep):]
    	}
    }
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Sep 03 20:55:15 UTC 2024
    - 35.6K bytes
    - Viewed (0)
Back to top