You must do this using a constructor that takes the number of bytes.
wxString w(aData+from, to-from);
for an existing one w, you could say
w.assign(aData+from, to-from);
or you can use the iterator version:
w.assign(aData+from, aData+to);
source
share