Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for Split (0.22 sec)

  1. misc/ios/detect.go

    	if err != nil {
    		return nil, err
    	}
    	return bytes.TrimSpace(out), nil
    }
    
    func getLines(cmd *exec.Cmd) [][]byte {
    	out := output(cmd)
    	lines := bytes.Split(out, []byte("\n"))
    	// Skip the empty line at the end.
    	if len(lines[len(lines)-1]) == 0 {
    		lines = lines[:len(lines)-1]
    	}
    	return lines
    }
    
    func output(cmd *exec.Cmd) []byte {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Oct 19 23:33:30 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  2. src/bytes/bytes.go

    	return genSplit(s, sep, len(sep), n)
    }
    
    // Split slices s into all subslices separated by sep and returns a slice of
    // the subslices between those separators.
    // If sep is empty, Split splits after each UTF-8 sequence.
    // It is equivalent to SplitN with a count of -1.
    //
    // To split around the first instance of a separator, see Cut.
    func Split(s, sep []byte) [][]byte { return genSplit(s, sep, 0, -1) }
    
    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)
  3. src/bufio/example_test.go

    	// Set the split function for the scanning operation.
    	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
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  4. src/bufio/scan.go

    	s.maxTokenSize = max
    }
    
    // Split sets the split function for the [Scanner].
    // The default split function is [ScanLines].
    //
    // Split panics if it is called after scanning has started.
    func (s *Scanner) Split(split SplitFunc) {
    	if s.scanCalled {
    		panic("Split called after Scan")
    	}
    	s.split = split
    }
    
    // Split functions
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  5. src/archive/tar/writer.go

    			pad := blockPadding(int64(len(spb)))
    			spb = append(spb, zeroBlock[:pad]...)
    			hdr.Size += int64(len(spb)) // Accounts for encoded sparse map
    
    			// Add and modify appropriate PAX records.
    			dir, file := path.Split(realName)
    			hdr.Name = path.Join(dir, "GNUSparseFile.0", file)
    			paxHdrs[paxGNUSparseMajor] = "1"
    			paxHdrs[paxGNUSparseMinor] = "0"
    			paxHdrs[paxGNUSparseName] = realName
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  6. src/cmd/asm/internal/asm/parse.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Package asm implements the parser and instruction generator for the assembler.
    // TODO: Split apart?
    package asm
    
    import (
    	"fmt"
    	"io"
    	"log"
    	"os"
    	"strconv"
    	"strings"
    	"text/scanner"
    	"unicode/utf8"
    
    	"cmd/asm/internal/arch"
    	"cmd/asm/internal/flags"
    	"cmd/asm/internal/lex"
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Feb 21 14:34:57 GMT 2024
    - 36.9K bytes
    - Viewed (0)
  7. src/archive/zip/reader.go

    			}
    		}
    
    		sort.Slice(r.fileList, func(i, j int) bool { return fileEntryLess(r.fileList[i].name, r.fileList[j].name) })
    	})
    }
    
    func fileEntryLess(x, y string) bool {
    	xdir, xelem, _ := split(x)
    	ydir, yelem, _ := split(y)
    	return xdir < ydir || xdir == ydir && xelem < yelem
    }
    
    // Open opens the named file in the ZIP archive,
    // using the semantics of fs.FS.Open:
    // paths are always slash separated, with no
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  8. src/cmd/addr2line/addr2line_test.go

    	if err != nil {
    		t.Fatalf("go tool addr2line %v: %v\n%s", os.Args[0], err, string(out))
    	}
    	f := strings.Split(string(out), "\n")
    	if len(f) < 3 && f[2] == "" {
    		t.Fatal("addr2line output must have 2 lines")
    	}
    	funcname = f[0]
    	pathAndLineNo := f[1]
    	f = strings.Split(pathAndLineNo, ":")
    	if runtime.GOOS == "windows" && len(f) == 3 {
    		// Reattach drive letter.
    		f = []string{f[0] + ":" + f[1], f[2]}
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Feb 21 22:16:54 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  9. src/bytes/example_test.go

    	// U+0068 'h'
    	// U+0065 'e'
    	// U+0072 'r'
    }
    
    func ExampleSplit() {
    	fmt.Printf("%q\n", bytes.Split([]byte("a,b,c"), []byte(",")))
    	fmt.Printf("%q\n", bytes.Split([]byte("a man a plan a canal panama"), []byte("a ")))
    	fmt.Printf("%q\n", bytes.Split([]byte(" xyz "), []byte("")))
    	fmt.Printf("%q\n", bytes.Split([]byte(""), []byte("Bernardo O'Higgins")))
    	// Output:
    	// ["a" "b" "c"]
    	// ["" "man " "plan " "canal panama"]
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  10. src/bytes/bytes_test.go

    		}
    
    		s := Join(a, []byte(tt.sep))
    		if string(s) != tt.s {
    			t.Errorf(`Join(Split(%q, %q, %d), %q) = %q`, tt.s, tt.sep, tt.n, tt.sep, s)
    		}
    		if tt.n < 0 {
    			b := Split([]byte(tt.s), []byte(tt.sep))
    			if !reflect.DeepEqual(a, b) {
    				t.Errorf("Split disagrees withSplitN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a)
    			}
    		}
    		if len(a) > 0 {
    			in, out := a[0], s
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top