Check a string for #### signs to see if the frame number should be inserted. Used for functions like saveFrame() and beginRecord() to replace the # marks with the frame number. If only one # is used, it will be ignored, under the assumption that it's probably not intended to be the frame number.
(String what)
| 3597 | * intended to be the frame number. |
| 3598 | */ |
| 3599 | public String insertFrame(String what) { |
| 3600 | int first = what.indexOf('#'); |
| 3601 | int last = what.lastIndexOf('#'); |
| 3602 | |
| 3603 | if ((first != -1) && (last - first > 0)) { |
| 3604 | String prefix = what.substring(0, first); |
| 3605 | int count = last - first + 1; |
| 3606 | String suffix = what.substring(last + 1); |
| 3607 | return prefix + nf(frameCount, count) + suffix; |
| 3608 | } |
| 3609 | return what; // no change |
| 3610 | } |
| 3611 | |
| 3612 | |
| 3613 |
no test coverage detected