Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 90 for chars (0.06 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/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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/os/removeall_test.go

    	}
    	defer RemoveAll(startPath)
    
    	err = Chdir(startPath)
    	if err != nil {
    		t.Fatalf("Could not chdir %s: %s", startPath, err)
    	}
    
    	// Removing paths with over 4096 chars commonly fails
    	for i := 0; i < 41; i++ {
    		name := strings.Repeat("a", 100)
    
    		err = Mkdir(name, 0755)
    		if err != nil {
    			t.Fatalf("Could not mkdir %s: %s", name, err)
    		}
    
    		err = Chdir(name)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:29 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  8. src/unicode/letter_test.go

    	0x2f800,
    	0x2fa1d,
    }
    
    var notletterTest = []rune{
    	0x20,
    	0x35,
    	0x375,
    	0x619,
    	0x700,
    	0x1885,
    	0xfffe,
    	0x1ffff,
    	0x10ffff,
    }
    
    // Contains all the special cased Latin-1 chars.
    var spaceTest = []rune{
    	0x09,
    	0x0a,
    	0x0b,
    	0x0c,
    	0x0d,
    	0x20,
    	0x85,
    	0xA0,
    	0x2000,
    	0x3000,
    }
    
    type caseT struct {
    	cas     int
    	in, out rune
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 09 01:46:03 UTC 2023
    - 14.8K bytes
    - Viewed (0)
  9. src/strings/strings_test.go

    		}
    	}
    	return -1
    }
    
    func TestIndexRandom(t *testing.T) {
    	const chars = "abcdefghijklmnopqrstuvwxyz0123456789"
    	for times := 0; times < 10; times++ {
    		for strLen := 5 + rand.Intn(5); strLen < 140; strLen += 10 { // Arbitrary
    			s1 := make([]byte, strLen)
    			for i := range s1 {
    				s1[i] = chars[rand.Intn(len(chars))]
    			}
    			s := string(s1)
    			for i := 0; i < 50; i++ {
    				begin := rand.Intn(len(s) + 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 53K bytes
    - Viewed (0)
  10. src/net/net_windows_test.go

    		if err != nil {
    			return err
    		}
    		defer c.Close()
    
    		b := []byte(data)
    		n, err := c.Write(b)
    		if err != nil {
    			return err
    		}
    		if n != len(b) {
    			return fmt.Errorf(`Only %d chars of string "%s" sent`, n, data)
    		}
    		return nil
    	}
    
    	if envaddr := os.Getenv("GOTEST_DIAL_ADDR"); envaddr != "" {
    		// In child process.
    		c, err := Dial("tcp", envaddr)
    		if err != nil {
    			t.Fatal(err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.3K bytes
    - Viewed (0)
Back to top