|
-
Feb 4th, 2011, 05:41 PM
#1
Thread Starter
Member
Counting Caracters in a String(NOT WORKING)
Ok, so I have a string called item. It's value is "Coffe`". When I try to get the number of caractors by using:
Code:
textcount = item.length
However it returns with the value "5". even though there is 6 caracters. Any ideas on how to fix this?
-
Feb 4th, 2011, 05:44 PM
#2
Re: Counting Caracters in a String(NOT WORKING)
Is that final thing a separate character, or is it an accented e? It looks like an apostrophe, which is clearly a character.
My usual boring signature: Nothing
 
-
Feb 4th, 2011, 05:50 PM
#3
Thread Starter
Member
Re: Counting Caracters in a String(NOT WORKING)
It is a separate caractor
-
Feb 4th, 2011, 06:04 PM
#4
Re: Counting Caracters in a String(NOT WORKING)
If item is a string, then it would have a character array. I would put a breakpoint on the line you posted, and take a close look at item. Every character would count in the length, so this is not making much sense, yet.
My usual boring signature: Nothing
 
-
Feb 4th, 2011, 06:08 PM
#5
Thread Starter
Member
Re: Counting Caracters in a String(NOT WORKING)
The value is:
Coffe`
when I try to find the number of caracters using the code above, it gives me the value
5
when it should be 6.
I think the value
`
is not being counted.
-
Feb 4th, 2011, 06:53 PM
#6
Re: Counting Caracters in a String(NOT WORKING)
Cutting and pasting that string and I get 6.
"Ok, my response to that is pending a Google search" - Bucky Katt.
"There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
"Before you can 'think outside the box' you need to understand where the box is."
-
Feb 4th, 2011, 07:29 PM
#7
Member
Re: Counting Caracters in a String(NOT WORKING)
 Originally Posted by domefavor95
Ok, so I have a string called item. It's value is "Coffe`". When I try to get the number of caractors by using:
Code:
textcount = item.length
However it returns with the value "5". even though there is 6 caracters. Any ideas on how to fix this?
Code:
Dim textcount As Integer
Dim item As String = "Coffe`"
textcount = item.length
This gives me 6.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|