Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 98 for chars (0.04 sec)

  1. src/strings/strings.go

    }
    
    // IndexAny returns the index of the first instance of any Unicode code point
    // from chars in s, or -1 if no Unicode code point from chars is present in s.
    func IndexAny(s, chars string) int {
    	if chars == "" {
    		// Avoid scanning all of s.
    		return -1
    	}
    	if len(chars) == 1 {
    		// Avoid scanning all of s.
    		r := rune(chars[0])
    		if r >= utf8.RuneSelf {
    			r = utf8.RuneError
    		}
    		return IndexRune(s, r)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 16:48:16 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  2. src/regexp/syntax/prog_test.go

    			r1 = r2
    		}
    		EmptyOpContext(r1, -1)
    	}
    }
    
    var sink any
    
    func BenchmarkIsWordChar(b *testing.B) {
    	const chars = "Don't communicate by sharing memory, share memory by communicating."
    	for i := 0; i < b.N; i++ {
    		for _, r := range chars {
    			sink = IsWordChar(r)
    		}
    	}
    	if sink == nil {
    		b.Fatal("Benchmark did not run")
    	}
    	sink = nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 14 04:39:42 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  3. src/internal/types/errors/codes_test.go

    			}
    		}
    	})
    
    	if testing.Verbose() {
    		var totChars, totCount int
    		for chars, count := range nameHist {
    			totChars += chars * count
    			totCount += count
    		}
    		avg := float64(totChars) / float64(totCount)
    		fmt.Println()
    		fmt.Printf("%d error codes\n", totCount)
    		fmt.Printf("average length: %.2f chars\n", avg)
    		fmt.Printf("max length: %d (%s)\n", len(longestName), longestName)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 18 20:41:45 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  4. src/cmd/internal/objabi/path.go

    // last segment of the path, and it makes for happier users if we escape that as
    // little as possible.
    func PathToPrefix(s string) string {
    	slash := strings.LastIndex(s, "/")
    	// check for chars that need escaping
    	n := 0
    	for r := 0; r < len(s); r++ {
    		if c := s[r]; c <= ' ' || (c == '.' && r > slash) || c == '%' || c == '"' || c >= 0x7F {
    			n++
    		}
    	}
    
    	// quick exit
    	if n == 0 {
    		return s
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 13:56:25 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  5. src/fmt/fmt_test.go

    		if i >= 0 && i < len(s) {
    			var pattern, chars string
    			switch {
    			case strings.HasPrefix(tt.out[i:], "PTR_b"):
    				pattern = "PTR_b"
    				chars = "01"
    			case strings.HasPrefix(tt.out[i:], "PTR_o"):
    				pattern = "PTR_o"
    				chars = "01234567"
    			case strings.HasPrefix(tt.out[i:], "PTR_d"):
    				pattern = "PTR_d"
    				chars = "0123456789"
    			case strings.HasPrefix(tt.out[i:], "PTR_x"):
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:31:55 UTC 2024
    - 58.6K bytes
    - Viewed (0)
  6. src/cmd/vendor/rsc.io/markdown/inline.go

    	p.list = p.mergePlain(p.list)
    	p.list = p.autoLinkText(p.list)
    
    	return p.list
    }
    
    func (ps *parseState) emph(dst, src []Inline) []Inline {
    	const chars = "_*~\"'"
    	var stack [len(chars)][]*emphPlain
    	stackOf := func(c byte) int {
    		return strings.IndexByte(chars, c)
    	}
    
    	trimStack := func() {
    		for i := range stack {
    			stk := &stack[i]
    			for len(*stk) > 0 && (*stk)[len(*stk)-1].i >= len(dst) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go

    			i++
    		}
    		tag = tag[i:]
    		if tag == "" {
    			break
    		}
    
    		// Scan to colon. A space, a quote or a control character is a syntax error.
    		// Strictly speaking, control chars include the range [0x7f, 0x9f], not just
    		// [0x00, 0x1f], but in practice, we ignore the multi-byte control characters
    		// as it is simpler to inspect the tag's bytes than the tag's runes.
    		i = 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 8.8K bytes
    - Viewed (0)
  8. src/fmt/scan_test.go

    func (t *TwoLines) Scan(state ScanState, verb rune) error {
    	chars := make([]rune, 0, 100)
    	for nlCount := 0; nlCount < 2; {
    		c, _, err := state.ReadRune()
    		if err != nil {
    			return err
    		}
    		chars = append(chars, c)
    		if c == '\n' {
    			nlCount++
    		}
    	}
    	*t = TwoLines(string(chars))
    	return nil
    }
    
    func TestMultiLine(t *testing.T) {
    	input := "abc\ndef\n"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 20:25:13 UTC 2023
    - 39.3K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/sys/windows/syscall_windows.go

    // in the form of "{XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}".
    func (guid GUID) String() string {
    	var str [100]uint16
    	chars := stringFromGUID2(&guid, &str[0], int32(len(str)))
    	if chars <= 1 {
    		return ""
    	}
    	return string(utf16.Decode(str[:chars-1]))
    }
    
    // KnownFolderPath returns a well-known folder path for the current user, specified by one of
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 05 22:18:42 UTC 2024
    - 82.8K bytes
    - Viewed (0)
  10. src/html/template/error.go

    	//   Maybe refactor recursive templates to not be recursive.
    	ErrOutputContext
    
    	// ErrPartialCharset: "unfinished JS regexp charset in ..."
    	// Example:
    	//     <script>var pattern = /foo[{{.Chars}}]/</script>
    	// Discussion:
    	//   Package html/template does not support interpolation into regular
    	//   expression literal character sets.
    	ErrPartialCharset
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 02 15:18:39 UTC 2023
    - 9.3K bytes
    - Viewed (0)
Back to top