How to remove the last character of the string in asp.net c#
In this article, I will remove the last charter of
the string that means we reduce the length of only one character of the string.
Source code:-
using System;
using
System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using
System.Web.UI.WebControls;
public partial class remove : System.Web.UI.Page
{
protected void Page_Load(object
sender, EventArgs e)
{
string
text = "Neeraj Srivastava";
text = text.Remove(text.Length - 1);
string
output = text;
}
}
Out-Put:-
How to remove the last character of the string in asp.net c#
Reviewed by NEERAJ SRIVASTAVA
on
7:35:00 PM
Rating:
![How to remove the last character of the string in asp.net c#](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5We8haJmmPoKfCWUXFgqi6M0GtwxcxMpmim_HZqN8cyPElw-X27huhBbPEV0KFCQPl5gtKR2TnbXkxrjCV0u4vZG-eaEB5EgKBnpSb68LiX0ulw9jLoYPJA9zS53mz4TDEip-HQ2DaAs/s72-c/out-put.png)
No comments: