Get Character At?

Clay Smith clayasaurus at gmail.com
Tue Apr 24 09:04:49 PDT 2007


okibi wrote:
> Derek Parnell Wrote:
> 
>> On Tue, 24 Apr 2007 10:30:16 -0400, okibi wrote:
>>
>>> Is there a getCharAt() function for D?
>> Get a character from what? A string, a file, a console screen, ... ?
>>
>> -- 
>> Derek Parnell
>> Melbourne, Australia
>> "Justice for David Hicks!"
>> skype: derek.j.parnell
> 
> Such as this:
> 
> char[] text = "This is a test sentence.";
> 
> int loc = 5;
> 
> char num5 = text.getCharAt(loc);
> 
> Something along those lines.
> 

Just use

char num5 = text[loc-1];

?


More information about the Digitalmars-d-learn mailing list