Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to store text without space(using textbox) in sql database??

how to store text without space(using textbox) in sql database??

Scheduled Pinned Locked Moved ASP.NET
databasequestiontutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    syibu
    wrote on last edited by
    #1

    hi guys,. i would like to store text(using textbox) in my database.. but i have lot of space between first and last name.. for eg: if i put 10 char space b/w first and last means i should print text with only single space.. question:- textbox1=syed hussain answer:- textbox2=syed hussain if anybody know the answer pls reply me!! thanks.

    S 1 Reply Last reply
    0
    • S syibu

      hi guys,. i would like to store text(using textbox) in my database.. but i have lot of space between first and last name.. for eg: if i put 10 char space b/w first and last means i should print text with only single space.. question:- textbox1=syed hussain answer:- textbox2=syed hussain if anybody know the answer pls reply me!! thanks.

      S Offline
      S Offline
      saini arun
      wrote on last edited by
      #2

      try the following code.... its written in c# string str = "Syed Hussain"; // our initial string str = str.Trim(); // remove any spaces from start and end of the string int index = str.IndexOf(" "); // get the index of the first space str = str.Replace(" ",""); // remove all spaces str = str.Insert(index, " "); // insert single space at the position of INDEX Label1.Text = str; // now you get the string with single space.

      “The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups