Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string StrDel(string, int, int);
- int main() {
- string str1 = "ingSSSRing";
- cout << StrDel(str1, 3, 7);
- }
- string StrDel(string s, int n, int k) {
- string start = s.substr(0, n);
- string end = s.substr(k);
- return start + end;
- }
- public class Main
- {
- public static void main (String[]args)
- {
- String s = "ingSSSRing";
- System.out.println(StrDel(s, 3, 7));
- }
- public static String StrDel (String s, int n, int k)
- {
- String start = s.substring (0, n);
- String end = s.substring (k);
- return start + end;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement