Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for TrimFunc (0.21 sec)

  1. internal/s3select/sql/stringfuncs.go

    	cutSet := " "
    	if trimChars != "" {
    		cutSet = trimChars
    	}
    
    	trimFunc := strings.Trim
    	switch {
    	case where == nil:
    	case *where == trimBoth:
    	case *where == trimLeading:
    		trimFunc = strings.TrimLeft
    	case *where == trimTrailing:
    		trimFunc = strings.TrimRight
    	default:
    		return "", errInvalidTrimArg
    	}
    
    	return trimFunc(text, cutSet), nil
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 4.2K bytes
    - Viewed (0)
  2. src/bytes/example_test.go

    	// Output: ["Achtung! Achtung"]
    }
    
    func ExampleTrimFunc() {
    	fmt.Println(string(bytes.TrimFunc([]byte("go-gopher!"), unicode.IsLetter)))
    	fmt.Println(string(bytes.TrimFunc([]byte("\"go-gopher!\""), unicode.IsLetter)))
    	fmt.Println(string(bytes.TrimFunc([]byte("go-gopher!"), unicode.IsPunct)))
    	fmt.Println(string(bytes.TrimFunc([]byte("1234go-gopher!567"), unicode.IsNumber)))
    	// Output:
    	// -gopher!
    	// "go-gopher!"
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  3. internal/s3select/sql/parser.go

    	From     *PrimaryTerm `parser:" \"FROM\" @@ \")\" "`
    }
    
    // TrimFunc represents TRIM sql function
    type TrimFunc struct {
    	TrimWhere *string      `parser:" \"TRIM\" \"(\" ( @( \"LEADING\" | \"TRAILING\" | \"BOTH\" ) "`
    	TrimChars *PrimaryTerm `parser:"             @@?  "`
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 12.9K bytes
    - Viewed (0)
  4. src/bytes/bytes.go

    	if i >= 0 && s[i] >= utf8.RuneSelf {
    		_, wid := utf8.DecodeRune(s[i:])
    		i += wid
    	} else {
    		i++
    	}
    	return s[0:i]
    }
    
    // TrimFunc returns a subslice of s by slicing off all leading and trailing
    // UTF-8-encoded code points c that satisfy f(c).
    func TrimFunc(s []byte, f func(r rune) bool) []byte {
    	return TrimRightFunc(TrimLeftFunc(s, f), f)
    }
    
    // TrimPrefix returns s without the provided leading prefix string.
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  5. internal/s3select/sql/funceval.go

    			return nil, errIncorrectSQLFunctionArgumentType(err)
    		}
    	}
    
    	res, err := evalSQLSubstring(s, int(startIdx), length)
    	return FromString(res), err
    }
    
    func handleSQLTrim(r Record, e *TrimFunc, tableAlias string) (res *Value, err error) {
    	chars := ""
    	ok := false
    	if e.TrimChars != nil {
    		charsV, cerr := e.TrimChars.evalNode(r, tableAlias)
    		if cerr != nil {
    			return nil, cerr
    		}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 13.2K bytes
    - Viewed (0)
  6. docs/debugging/xl-meta/main.go

    					b0 = fmt.Sprintf("%s: ", string(b))
    				}
    				b, err := decode(r, file)
    				if err != nil {
    					return err
    				}
    				b = bytes.TrimSpace(b)
    				if !ndjson {
    					b = bytes.TrimFunc(b, func(r rune) bool {
    						return r == '{' || r == '}' || r == '\n' || r == '\r'
    					})
    				}
    
    				toPrint = append(toPrint, fmt.Sprintf("%s%s", b0, string(b)))
    			}
    		}
    		sort.Strings(toPrint)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Apr 24 17:56:22 GMT 2024
    - 20.2K bytes
    - Viewed (1)
  7. src/bytes/bytes_test.go

    func TestTrimFunc(t *testing.T) {
    	for _, tc := range trimFuncTests {
    		trimmers := []struct {
    			name string
    			trim func(s []byte, f func(r rune) bool) []byte
    			out  []byte
    		}{
    			{"TrimFunc", TrimFunc, tc.trimOut},
    			{"TrimLeftFunc", TrimLeftFunc, tc.leftOut},
    			{"TrimRightFunc", TrimRightFunc, tc.rightOut},
    		}
    		for _, trimmer := range trimmers {
    			actual := trimmer.trim([]byte(tc.in), tc.f.f)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  8. api/go1.txt

    pkg bytes, func ToUpper([]uint8) []uint8
    pkg bytes, func ToUpperSpecial(unicode.SpecialCase, []uint8) []uint8
    pkg bytes, func Trim([]uint8, string) []uint8
    pkg bytes, func TrimFunc([]uint8, func(int32) bool) []uint8
    pkg bytes, func TrimLeft([]uint8, string) []uint8
    pkg bytes, func TrimLeftFunc([]uint8, func(int32) bool) []uint8
    pkg bytes, func TrimRight([]uint8, string) []uint8
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
Back to top