Method
trimLeading
(String str, String chars)
Source from the content-addressed store, hash-verified
| 777 | } |
| 778 | |
| 779 | public static String trimLeading(String str, String chars) |
| 780 | { |
| 781 | if (str != null && chars != null) |
| 782 | { |
| 783 | int i = str.length(); |
| 784 | |
| 785 | for (int j = 0; j < i; ++j) |
| 786 | { |
| 787 | char c0 = str.charAt(j); |
| 788 | |
| 789 | if (chars.indexOf(c0) < 0) |
| 790 | { |
| 791 | return str.substring(j); |
| 792 | } |
| 793 | } |
| 794 | |
| 795 | return ""; |
| 796 | } |
| 797 | else |
| 798 | { |
| 799 | return str; |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | public static String trimTrailing(String str, String chars) |
| 804 | { |
Tested by
no test coverage detected