mutable string

Adam Sansier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 10 14:26:29 PDT 2016


For example, I'm trying to compare a wchar buffer with a wstring 
using slices:

x[0..$] == y[0..$]

It fails. I think because x has length 1024. If do

x[0..y.length] == str[0..y.length]

it fails, also because y has length 1024(since it was generated 
from a buffer and the length wasn't set correctly).

If I fix the length to the size of y, it passes, but isn't 
correct since it is a partial match.

also, to lower fails but CharLowerBuff passes(the error in the 
previous post)

	//str = str.toLower();	
	CharLowerBuff(cast(LPTSTR)str, str.length);



More information about the Digitalmars-d-learn mailing list