Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update collates #90

Merged
merged 1 commit into from
Oct 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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