(String s, int len, char fillChar)
| 399 | } |
| 400 | |
| 401 | public static String fillLeft(String s, int len, char fillChar) |
| 402 | { |
| 403 | if (s == null) |
| 404 | { |
| 405 | s = ""; |
| 406 | } |
| 407 | |
| 408 | if (s.length() >= len) |
| 409 | { |
| 410 | return s; |
| 411 | } |
| 412 | else |
| 413 | { |
| 414 | StringBuffer stringbuffer = new StringBuffer(); |
| 415 | int i = len - s.length(); |
| 416 | |
| 417 | while (stringbuffer.length() < i) |
| 418 | { |
| 419 | stringbuffer.append(fillChar); |
| 420 | } |
| 421 | |
| 422 | return stringbuffer.toString() + s; |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | public static String fillRight(String s, int len, char fillChar) |
| 427 | { |
no test coverage detected