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. General Programming
  3. C#
  4. Help in Delimiter!

Help in Delimiter!

Scheduled Pinned Locked Moved C#
helpcsharpalgorithms
5 Posts 2 Posters 2 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.
  • A Offline
    A Offline
    ahjiefreak
    wrote on last edited by
    #1

    Hi, I actually facing problem in coding delimiter algorithm especially when user key in their entries in a rich textbox, the space that the user key in will be treated as delimiter (;).In other words, the space that user key-in after entering a word will be converted(interpreted) to ";" as delimiter symbol before user key in next word in the same line of text box as the second item. Please give me some guidance or any available reference/samples available algorithm on this in C# code.I need to clarify my doubts on this as soon as possible. Thanks..

    A 1 Reply Last reply
    0
    • A ahjiefreak

      Hi, I actually facing problem in coding delimiter algorithm especially when user key in their entries in a rich textbox, the space that the user key in will be treated as delimiter (;).In other words, the space that user key-in after entering a word will be converted(interpreted) to ";" as delimiter symbol before user key in next word in the same line of text box as the second item. Please give me some guidance or any available reference/samples available algorithm on this in C# code.I need to clarify my doubts on this as soon as possible. Thanks..

      A Offline
      A Offline
      Alexander Kent
      wrote on last edited by
      #2

      Maybe you mean something like this: string delimiter = ";"; textBox1.Text = textBox1.Text.Replace(" ", delimiter); :confused: ~Alexander Kent

      A 1 Reply Last reply
      0
      • A Alexander Kent

        Maybe you mean something like this: string delimiter = ";"; textBox1.Text = textBox1.Text.Replace(" ", delimiter); :confused: ~Alexander Kent

        A Offline
        A Offline
        ahjiefreak
        wrote on last edited by
        #3

        The above line provided does make sense..but how am i going to check if user key in space (" ") in the particular text box, the ";" will be replace onto it and the pointer for next word is after the symbol ";"? Thanks in advance, Lee

        A 1 Reply Last reply
        0
        • A ahjiefreak

          The above line provided does make sense..but how am i going to check if user key in space (" ") in the particular text box, the ";" will be replace onto it and the pointer for next word is after the symbol ";"? Thanks in advance, Lee

          A Offline
          A Offline
          Alexander Kent
          wrote on last edited by
          #4

          You can try and use the TextBox SelectionStart property – something like: In the KeyDown event if (e.KeyCode == Keys.Space) { // Cancel the event e.Handled = true; // Use your delimiter textBox1.Text += ";"; // Put the cursor after the newly appended text. textBox1.SelectionStart = textBox1.Text.Length; } ~Alexander Kent

          A 1 Reply Last reply
          0
          • A Alexander Kent

            You can try and use the TextBox SelectionStart property – something like: In the KeyDown event if (e.KeyCode == Keys.Space) { // Cancel the event e.Handled = true; // Use your delimiter textBox1.Text += ";"; // Put the cursor after the newly appended text. textBox1.SelectionStart = textBox1.Text.Length; } ~Alexander Kent

            A Offline
            A Offline
            ahjiefreak
            wrote on last edited by
            #5

            Yea..I have tried and it only works in C# form but what I face the problem of delimiter lies in Web Application Form in C# Project Folder..(fyi, I am trying to put my C# application into Web Based) I have tried to code the particular text box for the delimiter but it doesnt have SelectionStart function in Web Application.Thus, I used the previous code as below:- private void TextBox3_TextChanged(object sender, System.EventArgs e){ string delimiter =";"; if (TextBox3.Text.EndsWith(" ")) { TextBox3.Text += ";"; TextBox3.Text=TextBox3.Text.Repla ce(" ", delimiter); } } With this code, I face another problem which is when i enter the input then";" doesnt come up automatically..it only comes up occasionally especially after I let the Validation Error appear in other textbox. Please help me to clarify this doubt..I am stuck nowhere. Thanks, Lee

            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