Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Parser
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("String => ");
- string input = Console.ReadLine();
- int lunghezza = input.Length, chars = 0, chars2 = 0;
- char[] charac = new char[1000], other = new char[1000];
- for (int i = 0; i < 65; i+=2){
- charac[i] = Convert.ToChar(input[i]);
- chars++;
- }
- for (int k = 65; k < lunghezza; k++){
- other[k] = Convert.ToChar(input[k]);
- chars2++;
- }
- int total = chars + chars2;
- string formattata = new string(charac) + new string (other);
- Console.WriteLine("Input string {0}\nLength {1}\nFormatted {2}\nLength(should be 60 to be correct) {3}", input, lunghezza, formattata, total);
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment