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)
| 4004 | * intended to be the frame number. |
| 4005 | */ |
| 4006 | public String insertFrame(String what) { |
| 4007 | int first = what.indexOf('#'); |
| 4008 | int last = what.lastIndexOf('#'); |
| 4009 | |
| 4010 | if ((first != -1) && (last - first > 0)) { |
| 4011 | String prefix = what.substring(0, first); |
| 4012 | int count = last - first + 1; |
| 4013 | String suffix = what.substring(last + 1); |
| 4014 | return prefix + nf(frameCount, count) + suffix; |
| 4015 | } |
| 4016 | return what; // no change |
| 4017 | } |
| 4018 | |
| 4019 | |
| 4020 |
no test coverage detected