Guruji Point - Code You Want To Write

  • Home
  • Asp.Net
  • WCF
  • SQL
  • Type Script
  • AngularJS
  • Tech News
  • Blog
  • Earn Online

Saturday, 23 September 2017

Remove Extra Comma's From String In C#

 guruji point, Gurujipoint, remove commas from given string, remove comma, remove extra comma     No comments   


Introduction
In this article we will learn how to remove comma's from a string using c#. Remove unnecessary comma from a string. 

Previous Updates
In previous articles we have learnt  Transaction Commit and Rollback in sql server with example.What is Blocking and Deadlock In SQL.

Description
If you have a string with extra comma's separated and you need a exact formatted string separated by single comma then this will be a best solution for you.

Input
,,Your Name,,,Instance ,Transaction Number, Number
  ,First Name,Last Name,Destination Type,Destination,,Status,,,

Solution

string input = ",,Your Name,,,Instance ,Transaction Number, Number
  ,First Name,Last Name,Destination Type,Destination,,Status,,,";

string output = String.Join(",",input.Split(new[] { ',' },
                 StringSplitOptions.RemoveEmptyEntries)
               );

OutPut - 
Your Name,Instance ,Transaction Number, Number,First Name,Last Name,Destination Type,Destination,Status
Also Read - Insert only numeric values in Texbox. AngularJS  advancement of AngularJs . 






  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home
View mobile version

0 comments:

Post a Comment

Facebook Updates

Guruji Point

Categories

Comman table Expression in SQL Dynamic Grid Row IQueryable in c# Learn AngularJS Scope_Identity() Use of indexes comma seperated string in sql row_number() and dense_rank() salary table structure. while loop in sql why do we need cursor why tuple used

About Us

This blog is about the Programming ,Tech News and some intresting facts related Contents. Here you can find fundamental and expert level topic of programming languages very practically related to C# , Asp.Net ,Sql-Server, JavaScript, Jquery, WebServices And also Web-Api, WCF ,WPF, Angular Js.

Contact Us

Email Us - gurujipoints@gmail.com
Contact- 8077657477

Reach Us

Copyright © Guruji Point - Code You Want To Write