Remove first and last character from string

In this post I will explain about how to Remove first and last character from string with example.

Description:

In my previous posts I have explained various topics like Calculate age from Date of Birth in C#, Select random numbers items from list in C#, Sql Server Coalesce,Method Overloading, Abstract Class in C#

remove first and last character from string
remove first and last character from string

Now in this post, I will explain Remove first and last character from string with appropriate example.
First lets consider we have a string having round brackets and we want to remove these brackets from the string i.e. we need to remove first and last character from string. Let’s write query to get the expected result.

DECLARE @str VARCHAR(MAX) = '(remove this round bracket pair)'

SELECT SUBSTRING(@str,2,LEN(@str)-2) AS Result

when you run above query you will get below output.
remove this round bracket pair

Summary

You can also read about ASP.NET, JQuery, JSON, C#.Net

I hope you get an idea about how to get rid of first and last character from string.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you liked this post, don’t forget to share this.