1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

PGP Digital signature verifier class

This commit is contained in:
Cristian Maglie
2014-10-16 23:01:46 +02:00
committed by Federico Fissore
parent 8c49ee4206
commit 183c386e8c
3 changed files with 263 additions and 0 deletions

View File

@ -26,4 +26,18 @@ public class StringUtils {
String regex = pattern.replace("?", ".?").replace("*", ".*?");
return input.matches(regex);
}
/**
* Returns the string without trailing whitespace characters
*
* @param s
* @return
*/
public static String rtrim(String s) {
int i = s.length() - 1;
while (i >= 0 && Character.isWhitespace(s.charAt(i))) {
i--;
}
return s.substring(0, i + 1);
}
}