Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for DecodeRune (0.07 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/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)
  5. 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)
  6. 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)
Back to top