ASP.NET Hosting :: How to Clean a String in ASP.NET Making use of Comma Separated Values From Databases

This article will clarify how we can clear a string (eliminate some terms) in ASP.NET making use of comma divided values or words from databases table.

cheapaspnethosting
I’ve faced a circumstance once i have to clean a person enter string and remove some specific phrases from it but the phrases are within a database table as comma divided values. I’ve find the solution for my problem and written a function that will get comma divided values string and consumer input string as parameters and examine databases phrases with input string phrases and replace them with vacant string 1 by one and return a clear string. I’m going to share this code along with you in this post.

  1. Create a database and table and insert some words in it
  2. Create a new website in Visual Studio 2012 either in VB.NET or C#
  3. Write below code in button click event
    VB.NET

    C#
  4. Write below function in your file to clean string
    VB.NET

    C#
  5. Now start debugging, enter some string and see the result

Leave a Reply

Your email address will not be published.