Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for DecodeRune (0.05 sec)

  1. src/bytes/iter.go

    // bytes of sep to include in the results (none or all).
    func splitSeq(s, sep []byte, sepSave int) iter.Seq[[]byte] {
    	return func(yield func([]byte) bool) {
    		if len(sep) == 0 {
    			for len(s) > 0 {
    				_, size := utf8.DecodeRune(s)
    				if !yield(s[:size:size]) {
    					return
    				}
    				s = s[size:]
    			}
    			return
    		}
    		for {
    			i := Index(s, sep)
    			if i < 0 {
    				break
    			}
    			frag := s[:i+sepSave]
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed Sep 03 14:04:47 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  2. src/bytes/bytes.go

    	return len(s) == len(t)
    
    hasUnicode:
    	s = s[i:]
    	t = t[i:]
    	for len(s) != 0 && len(t) != 0 {
    		// Extract first rune from each.
    		sr, size := utf8.DecodeRune(s)
    		s = s[size:]
    		tr, size := utf8.DecodeRune(t)
    		t = t[size:]
    
    		// If they match, keep going; if not, return false.
    
    		// Easy case.
    		if tr == sr {
    			continue
    		}
    
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed Sep 03 14:04:47 UTC 2025
    - 35.5K bytes
    - Viewed (0)
  3. src/bufio/scan.go

    	start := 0
    	for width := 0; start < len(data); start += width {
    		var r rune
    		r, width = utf8.DecodeRune(data[start:])
    		if !isSpace(r) {
    			break
    		}
    	}
    	// Scan until space, marking end of word.
    	for width, i := 0, start; i < len(data); i += width {
    		var r rune
    		r, width = utf8.DecodeRune(data[i:])
    		if isSpace(r) {
    			return i + width, data[start:i], nil
    		}
    	}
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed May 21 18:05:26 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  4. src/bytes/reader.go

    	if r.i >= int64(len(r.s)) {
    		r.prevRune = -1
    		return 0, 0, io.EOF
    	}
    	r.prevRune = int(r.i)
    	if c := r.s[r.i]; c < utf8.RuneSelf {
    		r.i++
    		return rune(c), 1, nil
    	}
    	ch, size = utf8.DecodeRune(r.s[r.i:])
    	r.i += int64(size)
    	return
    }
    
    // UnreadRune complements [Reader.ReadRune] in implementing the [io.RuneScanner] interface.
    func (r *Reader) UnreadRune() error {
    	if r.i <= 0 {
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Tue Jul 16 18:17:37 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  5. src/bufio/scan_test.go

    		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)
    			}
    		}
    		if s.Scan() {
    			t.Errorf("#%d: scan ran too long, got %q", n, s.Text())
    		}
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Fri Sep 22 16:22:42 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  6. src/bytes/buffer.go

    		b.Reset()
    		return 0, 0, io.EOF
    	}
    	c := b.buf[b.off]
    	if c < utf8.RuneSelf {
    		b.off++
    		b.lastRead = opReadRune1
    		return rune(c), 1, nil
    	}
    	r, n := utf8.DecodeRune(b.buf[b.off:])
    	b.off += n
    	b.lastRead = readOp(n)
    	return r, n, nil
    }
    
    // UnreadRune unreads the last rune returned by [Buffer.ReadRune].
    // If the most recent read or write operation on the buffer was
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Mon May 19 17:38:56 UTC 2025
    - 16K bytes
    - Viewed (0)
  7. src/bufio/bufio.go

    		b.fill() // b.w-b.r < len(buf) => buffer is not full
    	}
    	b.lastRuneSize = -1
    	if b.r == b.w {
    		return 0, 0, b.readErr()
    	}
    	r, size = utf8.DecodeRune(b.buf[b.r:b.w])
    	b.r += size
    	b.lastByte = int(b.buf[b.r-1])
    	b.lastRuneSize = size
    	return r, size, nil
    }
    
    // UnreadRune unreads the last rune. If the most recent method called on
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed Sep 03 14:04:47 UTC 2025
    - 22K bytes
    - Viewed (0)
  8. src/bytes/bytes_test.go

    					i += len(old)
    					n--
    					if len(old) != 0 {
    						continue
    					}
    					if i == len(in) {
    						break
    					}
    				}
    				if len(old) == 0 {
    					_, length := utf8.DecodeRune(in[i:])
    					out.Write(in[i : i+length])
    					i += length
    				} else {
    					out.WriteByte(in[i])
    					i++
    				}
    			}
    			if len(old) == 0 && n != 0 {
    				out.Write(new)
    			}
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Mon Jul 28 18:13:58 UTC 2025
    - 62.9K bytes
    - Viewed (0)
  9. api/go1.txt

    pkg unicode, var Z *RangeTable
    pkg unicode, var Zl *RangeTable
    pkg unicode, var Zp *RangeTable
    pkg unicode, var Zs *RangeTable
    pkg unicode/utf16, func Decode([]uint16) []int32
    pkg unicode/utf16, func DecodeRune(int32, int32) int32
    pkg unicode/utf16, func Encode([]int32) []uint16
    pkg unicode/utf16, func EncodeRune(int32) (int32, int32)
    pkg unicode/utf16, func IsSurrogate(int32) bool
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top