Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Prints out a section from string <>source</> with <>start</> as beginning index and <>end</> as final index.
- * @param source The string we take a section from.
- * @param start The index of the starting character.
- * @param end The index of the final character.
- * @return string output - the given section from source.
- *
- * @author Dimitar Naydenov
- */
- public static String section(String source, int start, int end) {
- String output = "";
- for (int i = start; i <=end ; i++) {
- output += source.charAt(i);
- }
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement