using System;
namespace DateTimeSpanExample
{
public class Program
{
public void Main(string[] args)
{
string removeFirst = "/examples/csharp/";
//using remove method
var
rf=removeFirst.Remove(0, 1);
Console.WriteLine(rf);
//using trimstart
var ts=removeFirst.TrimStart('/');
Console.WriteLine(ts);
//using substring
var
ss=removeFirst.Substring(1);
Console.WriteLine(ss);
//using indexof
var
io=removeFirst.Remove(removeFirst.IndexOf("/"), 1);
Console.WriteLine(io);
Console.Read();
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.