Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 158 for isspace (0.14 sec)

  1. src/net/parse.go

    // trimSpace returns x without any leading or trailing ASCII whitespace.
    func trimSpace(x string) string {
    	for len(x) > 0 && isSpace(x[0]) {
    		x = x[1:]
    	}
    	for len(x) > 0 && isSpace(x[len(x)-1]) {
    		x = x[:len(x)-1]
    	}
    	return x
    }
    
    // isSpace reports whether b is an ASCII space character.
    func isSpace(b byte) bool {
    	return b == ' ' || b == '\t' || b == '\n' || b == '\r'
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 14:00:54 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  2. src/mime/mediatype.go

    	rest = strings.TrimLeftFunc(v, unicode.IsSpace)
    	if !strings.HasPrefix(rest, ";") {
    		return "", "", v
    	}
    
    	rest = rest[1:] // consume semicolon
    	rest = strings.TrimLeftFunc(rest, unicode.IsSpace)
    	param, rest = consumeToken(rest)
    	param = strings.ToLower(param)
    	if param == "" {
    		return "", "", v
    	}
    
    	rest = strings.TrimLeftFunc(rest, unicode.IsSpace)
    	if !strings.HasPrefix(rest, "=") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  3. src/fmt/scan.go

    					if !isSpace(inputc) && inputc != eof {
    						s.errorString("expected space in input to match format")
    					}
    					if inputc == '\n' {
    						s.errorString("newline in input does not match format")
    					}
    				}
    				for isSpace(inputc) && inputc != '\n' {
    					inputc = s.getRune()
    				}
    				if inputc != eof {
    					s.UnreadRune()
    				}
    			}
    			continue
    		}
    
    		// Verbs.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:56:20 UTC 2024
    - 31.9K bytes
    - Viewed (0)
  4. src/text/template/parse/lex.go

    	}
    }
    
    // lexSpace scans a run of space characters.
    // We have not consumed the first space, which is known to be present.
    // Take care if there is a trim-marked right delimiter, which starts with a space.
    func lexSpace(l *lexer) stateFn {
    	var r rune
    	var numSpaces int
    	for {
    		r = l.peek()
    		if !isSpace(r) {
    			break
    		}
    		l.next()
    		numSpaces++
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 04 22:36:12 UTC 2022
    - 18.1K bytes
    - Viewed (0)
  5. pkg/test/framework/resource/matcher.go

    			}
    		}
    		i++
    	}
    	return append(a, s)
    }
    
    // rewrite rewrites a subname to having only printable characters and no white
    // space.
    // From go/src/testing/match.go
    func rewrite(s string) string {
    	b := []byte{}
    	for _, r := range s {
    		switch {
    		case isSpace(r):
    			b = append(b, '_')
    		case !strconv.IsPrint(r):
    			s := strconv.QuoteRune(r)
    			b = append(b, s[1:len(s)-1]...)
    		default:
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 12 23:30:37 UTC 2021
    - 3.2K bytes
    - Viewed (0)
  6. src/encoding/json/scanner.go

    	}
    	return s.error(c, "")
    }
    
    // stateEndTop is the state after finishing the top-level value,
    // such as after reading `{}` or `[1,2,3]`.
    // Only space characters should be seen now.
    func stateEndTop(s *scanner, c byte) int {
    	if !isSpace(c) {
    		// Complain about non-space byte on next call.
    		s.error(c, "after top-level value")
    	}
    	return scanEnd
    }
    
    // stateInString is the state after reading `"`.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 16.1K bytes
    - Viewed (0)
  7. src/unicode/graphic.go

    	}
    	return Is(Punct, r)
    }
    
    // IsSpace reports whether the rune is a space character as defined
    // by Unicode's White Space property; in the Latin-1 space
    // this is
    //
    //	'\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).
    //
    // Other definitions of spacing characters are set by category
    // Z and property [Pattern_White_Space].
    func IsSpace(r rune) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 06 20:02:46 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  8. src/cmd/go/internal/envcmd/env_test.go

    					" isn't testing.", s)
    			}
    			if c > unicode.MaxASCII {
    				t.Skipf("skipping %#q: contains a non-ASCII character %q", s, c)
    			}
    			if !unicode.IsGraphic(rune(c)) && !unicode.IsSpace(rune(c)) {
    				t.Skipf("skipping %#q: contains non-graphic character %q", s, c)
    			}
    			if runtime.GOOS == "windows" && c == '\r' || c == '\n' {
    				t.Skipf("skipping %#q on Windows: contains unescapable character %q", s, c)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  9. src/strings/strings_test.go

    		"not " + p.name,
    	}
    }
    
    var trimFuncTests = []struct {
    	f        predicate
    	in       string
    	trimOut  string
    	leftOut  string
    	rightOut string
    }{
    	{isSpace, space + " hello " + space,
    		"hello",
    		"hello " + space,
    		space + " hello"},
    	{isDigit, "\u0e50\u0e5212hello34\u0e50\u0e51",
    		"hello",
    		"hello34\u0e50\u0e51",
    		"\u0e50\u0e5212hello"},
    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/strings/strings.go

    	for i := 0; i < len(s); i++ {
    		r := s[i]
    		setBits |= r
    		isSpace := int(asciiSpace[r])
    		n += wasSpace & ^isSpace
    		wasSpace = isSpace
    	}
    
    	if setBits >= utf8.RuneSelf {
    		// Some runes in the input string are not ASCII.
    		return FieldsFunc(s, unicode.IsSpace)
    	}
    	// ASCII fast path
    	a := make([]string, n)
    	na := 0
    	fieldStart := 0
    	i := 0
    	// Skip spaces in the front of the input.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 16:48:16 UTC 2024
    - 31.2K bytes
    - Viewed (0)
Back to top