Click here to Skip to main content
15,916,318 members
Home / Discussions / C#
   

C#

 
Generalyou asked for it Pin
Luc Pattyn9-Jan-09 13:07
sitebuilderLuc Pattyn9-Jan-09 13:07 
QuestionText.Length Command Pin
asquaredtech9-Jan-09 8:51
asquaredtech9-Jan-09 8:51 
AnswerRe: Text.Length Command Pin
JByrd20069-Jan-09 8:58
JByrd20069-Jan-09 8:58 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 9:15
asquaredtech9-Jan-09 9:15 
GeneralRe: Text.Length Command Pin
Colin Angus Mackay9-Jan-09 10:19
Colin Angus Mackay9-Jan-09 10:19 
AnswerRe: Text.Length Command Pin
Eddy Vluggen9-Jan-09 9:13
professionalEddy Vluggen9-Jan-09 9:13 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 9:18
asquaredtech9-Jan-09 9:18 
GeneralRe: Text.Length Command Pin
Guffa9-Jan-09 17:19
Guffa9-Jan-09 17:19 
asquaredtech wrote:
I subtract 1 because the .Length is 1 based, the index into the string is 0 based.


That is not correct. The length is zero based, a one based length would not make sense.

The value 4 means four characters, not three.

Also, if the length really would have been one based, you would have to add one to the value instead of subtracting one.

Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 19:05
asquaredtech9-Jan-09 19:05 
GeneralRe: Text.Length Command Pin
Guffa9-Jan-09 19:54
Guffa9-Jan-09 19:54 
GeneralRe: Text.Length Command Pin
Luc Pattyn9-Jan-09 9:31
sitebuilderLuc Pattyn9-Jan-09 9:31 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 10:14
asquaredtech9-Jan-09 10:14 
GeneralRe: Text.Length Command Pin
Colin Angus Mackay9-Jan-09 10:24
Colin Angus Mackay9-Jan-09 10:24 
GeneralRe: Text.Length Command Pin
Luc Pattyn9-Jan-09 10:27
sitebuilderLuc Pattyn9-Jan-09 10:27 
AnswerRe: Text.Length Command Pin
Rutvik Dave9-Jan-09 10:32
professionalRutvik Dave9-Jan-09 10:32 
AnswerRe: Text.Length Command Pin
Henry Minute9-Jan-09 10:51
Henry Minute9-Jan-09 10:51 
GeneralRe: Text.Length Command Pin
Colin Angus Mackay9-Jan-09 11:04
Colin Angus Mackay9-Jan-09 11:04 
GeneralRe: Text.Length Command Pin
Henry Minute9-Jan-09 11:28
Henry Minute9-Jan-09 11:28 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 19:24
asquaredtech9-Jan-09 19:24 
GeneralRe: Text.Length Command Pin
Henry Minute9-Jan-09 23:45
Henry Minute9-Jan-09 23:45 
GeneralRe: Text.Length Command Pin
Luc Pattyn9-Jan-09 11:35
sitebuilderLuc Pattyn9-Jan-09 11:35 
GeneralRe: Text.Length Command Pin
Henry Minute9-Jan-09 11:36
Henry Minute9-Jan-09 11:36 
AnswerRe: Text.Length Command Pin
asquaredtech9-Jan-09 11:25
asquaredtech9-Jan-09 11:25 
GeneralRe: Text.Length Command Pin
Henry Minute9-Jan-09 11:33
Henry Minute9-Jan-09 11:33 
GeneralRe: Text.Length Command Pin
Colin Angus Mackay9-Jan-09 13:35
Colin Angus Mackay9-Jan-09 13:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.