Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Duplicates a string count times. If count is
- // not a positive number then the empty string
- // is returned.
- String Duplicate(String src, int count) {
- String result = "";
- for (int i = 0; i < count; i++) {
- result += src;
- }
- return result;
- }
Add Comment
Please, Sign In to add comment