Skip to content

Commit

Permalink
Update collate
Browse files Browse the repository at this point in the history
  • Loading branch information
qhng committed Oct 26, 2016
1 parent 8063708 commit c13abd2
Show file tree
Hide file tree
Showing 34 changed files with 2,707 additions and 902 deletions.
605 changes: 3 additions & 602 deletions collated/main/A0139915W.md

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions collated/main/A0139915Wreused.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,3 @@
return strings.stream().filter(s -> s.contains(query.toLowerCase())).count() > 0;
}
```
###### \java\seedu\savvytasker\commons\util\StringUtil.java
``` java

public static boolean containsIgnoreCase(String source, String query) {
String[] split = source.toLowerCase().split("\\s+");
List<String> strings = Arrays.asList(split);
return strings.stream().filter(s -> s.equals(query.toLowerCase())).count() > 0;
}

/**
* Returns a detailed message of the t, including the stack trace.
*/
public static String getDetails(Throwable t){
assert t != null;
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
return t.getMessage() + "\n" + sw.toString();
}

/**
* Returns true if s represents an unsigned integer e.g. 1, 2, 3, ... <br>
* Will return false for null, empty string, "-1", "0", "+1", and " 2 " (untrimmed) "3 0" (contains whitespace).
* @param s Should be trimmed.
*/
public static boolean isUnsignedInteger(String s){
return s != null && s.matches("^0*[1-9]\\d*$");
}
}
```
Loading

0 comments on commit c13abd2

Please sign in to comment.