Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- namespace test
- {
- class Program
- {
- static void Main()
- {
- string a = Console.ReadLine ();
- StringBuilder str = new StringBuilder (a);
- int n = str.Length;
- if (n % 2 == 0) {
- int idx = n / 2 - 1;
- str.Remove (idx, 2);
- } else {
- int idx = n / 2;
- str.Remove (idx, 1);
- }
- Console.WriteLine ("New string = {0}", str);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment