Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. string s = "This is string";
  2.  
  3. s.RemoveAt(2);
  4.  
  5. string s = "This is string";
  6. s = s.Remove(2, 1);
  7.  
  8. Console.WriteLine(Regex.Replace("This is string", @"(?<=^.{2}).", ""));
  9.  
  10. s = s.Remove(2, 1);
  11.  
  12. public static class MyStringExtensions
  13. {
  14. public static string RemoveAt(this string s, int index)
  15. {
  16. return s.Remove(index, 1);
  17. }
  18. }
  19.  
  20. string s = "This is string";
  21. s = s.RemoveAt(2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement