MCPcopy Create free account
hub / github.com/gobeam/stringy / Boolean

Method Boolean

stringy.go:101–113  ·  view source on GitHub ↗

Boolean func returns boolean value of string value like on, off, 0, 1, yes, no returns boolean value of string input. You can chain this function on other function which returns implemented StringManipulation interface

()

Source from the content-addressed store, hash-verified

99// returns boolean value of string input. You can chain this function on other function
100// which returns implemented StringManipulation interface
101func (i *input) Boolean() bool {
102 input := getInput(*i)
103 inputLower := strings.ToLower(input)
104 off := contains(False, inputLower)
105 if off {
106 return false
107 }
108 on := contains(True, inputLower)
109 if on {
110 return true
111 }
112 panic(errors.New(InvalidLogicalString))
113}
114
115// CamelCase is variadic function which takes one Param rule i.e slice of strings and it returns
116// input type string in camel case form and rule helps to omit character you want to omit from string.

Callers

nothing calls this directly

Calls 3

getInputFunction · 0.85
containsFunction · 0.85
ToLowerMethod · 0.65

Tested by

no test coverage detected