Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for RuneCount (0.23 sec)

  1. src/bufio/scan_test.go

    	for n, test := range scanTests {
    		buf := strings.NewReader(test)
    		s := NewScanner(buf)
    		s.Split(ScanRunes)
    		var i, runeCount int
    		var expect rune
    		// Use a string range loop to validate the sequence of runes.
    		for i, expect = range test {
    			if !s.Scan() {
    				break
    			}
    			runeCount++
    			got, _ := utf8.DecodeRune(s.Bytes())
    			if got != expect {
    				t.Errorf("#%d: %d: expected %q got %q", n, i, expect, got)
    			}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 22 16:22:42 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  2. 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 max(x, y int) int {
    	if x < y {
    		return y
    	}
    	return x
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Sat Oct 08 04:41:42 GMT 2022
    - 2.8K bytes
    - Viewed (0)
  3. 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):]
    	}
    }
    
    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. api/go1.txt

    pkg unicode/utf8, func EncodeRune([]uint8, int32) int
    pkg unicode/utf8, func FullRune([]uint8) bool
    pkg unicode/utf8, func FullRuneInString(string) bool
    pkg unicode/utf8, func RuneCount([]uint8) int
    pkg unicode/utf8, func RuneCountInString(string) int
    pkg unicode/utf8, func RuneLen(int32) int
    pkg unicode/utf8, func RuneStart(uint8) bool
    pkg unicode/utf8, func Valid([]uint8) bool
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
Back to top