Click here to Skip to main content
14,667,169 members
Rate this:
Please Sign up or sign in to vote.
See more:
X=0
For i = 0 To TextBoxLength – 1
X=x+1
If ( TextBox1.Text(i) =" " ) then 

TextBox1 = TextBox1.Replace(" ", (20-x))      

Next i

this code use to give size term in text by vb.net2010?????
Posted
Updated 4-Apr-12 2:31am
v2
Comments
Prasad_Kulkarni 4-Apr-12 8:32am
   
..and the question is??
Manoj Kumar Choubey 4-Apr-12 8:56am
   
What do you want to do ..... ???? explain more "size" what size do you want to calculate .....

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 2

Following is your code , I am Modified only ....

D
       im X As Integer = 0
      Dim i As Integer
      Dim TextBoxLength As Integer = 0

      TextBoxLength = TextBox1.Text.Length

      For i = 0 To TextBoxLength - 1
          X = X + 1
          If TextBox1.Text.Substring(i) = " " Then
              TextBox1.Text = TextBox1.Text.Replace(" ", (20 - X))
          End If

      Next i

Please explain following things
1. TextBox1.Text.Replace(" ", (20 - X))? and 20 - x ?
2. What do you want to do exactly ?
   
Comments
Manoj Kumar Choubey 4-Apr-12 12:43pm
   
Ohh do you want to calculate number of space's between (words) terms .....
terms means words
You have a text file and you need to count space's in it and display to text box
Am I wirte ....
explain so I can help you ...... :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100