Sha256: fa4d6c532d9e8fe8fb61f4709b69ffaf7603b601ff70ceeb29d335c4716996a1

Contents?: true

Size: 536 Bytes

Versions: 66

Compression:

Stored size: 536 Bytes

Contents

class Bob {
  String hey(String message) {
    if (message.trim().isEmpty) {
      return "Fine. Be that way!";
    }

    if (message == "WHAT THE HELL WERE YOU THINKING?") {
      return "Calm down, I know what I'm doing!";
    }

    if (message == message.toUpperCase() && message != message.toLowerCase()) {
      return "Whoa, chill out!";
    }

    final RegExp whitespaceEndingQuestion = new RegExp(r'\?[\s]*$');

    if (whitespaceEndingQuestion.hasMatch(message)) {
      return "Sure.";
    }

    return "Whatever.";
  }
}

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.179 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.178 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.177 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.176 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.175 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.174 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.173 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.172 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.171 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.170 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.169 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.167 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.166 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.165 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.164 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.163 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.162 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.161 tracks/dart/exercises/bob/lib/example.dart
trackler-2.2.1.160 tracks/dart/exercises/bob/lib/example.dart