import java.util.Scanner; public class Phrases{ public static void main (String[]args){ Scanner keyboard = new Scanner(System.in); int option = Integer.parseInt(keyboard.nextLine()); String phrase = keyboard.nextLine(); if (option == 1){ int x = keyboard.nextInt(); for (int y = 0; y < phrase.length(); y++){ char n = phrase.charAt(y); if (y < phrase.length()-y) System.out.print(n); if (y == x - 1) System.out.print(n); } }
public class TestSubstring{ public static void main(String args[]){ String s="SachinTendulkar"; System.out.println(s.substring(6));//Tendulkar System.out.println(s.substring(0,6));//Sachin } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)