Sha256: a0558d7f7889c83fd11885a3a133f8b91d47002e29c73f0511b04e5a3626cec6
Contents?: true
Size: 732 Bytes
Versions: 396
Compression:
Stored size: 732 Bytes
Contents
Public Class Bob Public Function Hey(statement As String) As String If IsSilence(statement) Then Return "Fine. Be that way!" End If If IsYelling(statement) Then Return "Whoa, chill out!" End If If IsQuestion(statement) Then Return "Sure." Else Return "Whatever." End If End Function Private Function IsSilence(statement As String) As Boolean Return statement.Trim() = "" End Function Private Function IsYelling(statement As String) As Boolean Return statement.ToUpper() = statement AndAlso System.Text.RegularExpressions.Regex.IsMatch(statement, "[a-zA-Z]+") End Function Private Function IsQuestion(statement As String) As Boolean Return statement.EndsWith("?") End Function End Class
Version data entries
396 entries across 396 versions & 1 rubygems