nsAString::iterator writer; aDest.SetLength(Distance(aSrcStart, aSrcEnd)); aDest.BeginWriting(writer); nsAString::const_iterator fromBegin(aSrcStart);  copy_string(fromBegin, aSrcEnd, writer);
nsAString::const_iterator fromBegin, fromEnd; PRUnichar* toBegin = aDest; copy_string(aSource.BeginReading(fromBegin).advance( PRInt32(aSrcOffset) ), aSource.BeginReading(fromEnd).advance( PRInt32(aSrcOffset+aLength) ), toBegin); return aDest;
CopyUnicodeTo( const nsAString::const_iterator& aSrcStart,               const nsAString::const_iterator& aSrcEnd,               nsAString& aDest )  {    nsAString::iterator writer;    aDest.SetLength(Distance(aSrcStart, aSrcEnd));    aDest.BeginWriting(writer);    nsAString::const_iterator fromBegin(aSrcStart);        copy_string(fromBegin, aSrcEnd, writer);  }