SailorFini

C# - Hello World

Apr 8th, 2020
1,721
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Console.WriteLine("Hello World!");
  2. string aFriend = "Minecraft Steve";
  3. string bFriend = "Lego Man";
  4. Console.WriteLine(aFriend);
  5. Console.WriteLine($"{aFriend} has fallen into the river of Lego City");
  6. Console.WriteLine($"However {bFriend} refuses to help {aFriend}");
  7. Console.WriteLine($"But did you know that {bFriend} has {bFriend.Length} letters!");
  8. Console.WriteLine($"Whilst {aFriend} has {aFriend.Length} letters.");
  9. //
  10. string greeting = "      What's up?       ";
  11. Console.WriteLine($"[{greeting}]");
  12. string trimmedGreeting = greeting.TrimStart();
  13. Console.WriteLine($"[{trimmedGreeting}]");
  14. trimmedGreeting = greeting.TrimEnd();
  15. Console.WriteLine($"[{trimmedGreeting}]");
  16. trimmedGreeting = greeting.Trim();
  17. Console.WriteLine($"[{trimmedGreeting}]");
  18. string sayYeet = "Yeet";
  19. Console.WriteLine(sayYeet);
  20. sayYeet = sayYeet.Replace("Yeet", "Lit Fam Gucci");
  21. Console.WriteLine(sayYeet);
  22. Console.WriteLine(sayYeet.ToUpper());
  23. Console.WriteLine(sayYeet.ToLower());
  24. //
  25. string songLyrics = "A man has fallen into the river of Lego City";
  26. Console.WriteLine(songLyrics.Contains("river"));
  27. Console.WriteLine(songLyrics.Contains("Township"));
  28. Console.WriteLine(songLyrics.StartsWith("A"));
  29. Console.WriteLine(songLyrics.EndsWith("Rural-Community"));
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×