Advertisement
ChaosTheosis

String

Jan 26th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Tutorial_Project_1.Tutorial_1_Examples
  8. {
  9.     class String
  10.     {
  11.        static void Main()
  12.         {
  13.  
  14.             //Manipulate text
  15.  
  16.             string[] y = new string[] { "test1", "test2", "test3" };
  17.            foreach (string z in y)
  18.            {
  19.                Console.WriteLine(z);
  20.            }
  21.  
  22.            //You can convert things like decimals and strings etc with Convert.
  23.            
  24.            string age = "34";
  25.            string sal = "97456.71";
  26.  
  27.            int g = Convert.ToInt32(age);
  28.            Console.WriteLine(g / 2);
  29.  
  30.            Console.WriteLine(Convert.ToDouble(sal) * .02);
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement