Mistři v programování na #hovnokod

Jiné #4418

Swift

class StringBool {
	var majorString: String
	
	init(majorString: String) {
		self.majorString = majorString
	}
	
	public func isMajorStringTrue() -> Bool? {
		if majorString == "yes" ||  majorString == "Yes" || majorString == "YES"  {
			return true
		} else if majorString == "no" ||  majorString == "No" || majorString == "NO" {
			return false 
		} else {
			return nil 
		}
}

Filip Bulda Bulander,