- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for ScanWords (0.08 sec)
-
src/bufio/example_test.go
scanner.Split(bufio.ScanWords) // Count the words. count := 0 for scanner.Scan() { count++ } if err := scanner.Err(); err != nil { fmt.Fprintln(os.Stderr, "reading input:", err) } fmt.Printf("%d\n", count) // Output: 15 } // Use a Scanner with a custom split function (built by wrapping ScanWords) to validate // 32-bit decimal input.
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Nov 01 21:52:12 UTC 2024 - 5.5K bytes - Viewed (0) -
src/bufio/scan_test.go
// Test that the word splitter returns the same data as strings.Fields. func TestScanWords(t *testing.T) { for n, test := range wordScanTests { buf := strings.NewReader(test) s := NewScanner(buf) s.Split(ScanWords) words := strings.Fields(test) var wordCount int for wordCount = 0; wordCount < len(words); wordCount++ { if !s.Scan() { break } got := s.Text() if got != words[wordCount] {
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Sep 22 16:22:42 UTC 2023 - 14.3K bytes - Viewed (0) -
src/bufio/scan.go
return true } return false } // ScanWords is a split function for a [Scanner] that returns each // space-separated word of text, with surrounding spaces deleted. It will // never return an empty string. The definition of space is set by // unicode.IsSpace. func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error) { // Skip leading spaces. start := 0
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Oct 23 09:06:30 UTC 2023 - 14.2K bytes - Viewed (0) -
api/go1.1.txt
pkg bufio, func ScanBytes([]uint8, bool) (int, []uint8, error) pkg bufio, func ScanLines([]uint8, bool) (int, []uint8, error) pkg bufio, func ScanRunes([]uint8, bool) (int, []uint8, error) pkg bufio, func ScanWords([]uint8, bool) (int, []uint8, error) pkg bufio, method (*Reader) WriteTo(io.Writer) (int64, error) pkg bufio, method (*Scanner) Bytes() []uint8 pkg bufio, method (*Scanner) Err() error pkg bufio, method (*Scanner) Scan() bool
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Thu Mar 31 20:37:15 UTC 2022 - 2.6M bytes - Viewed (0)