Byte array to string

Tech-Archive recommends: Fix windows errors by optimizing your registry



Relative newbie here using VB6 SP5.

Isn't there a faster way than looping through each element of a byte array to
extract a string? I seem to recall seeing a way to do it in one simple function
call but for the life of me I can't find it now. Or am I remembering wrong?

So if a byte array contained:
68 97 108 101 66

Instead of looping though concatenating CHR$(bytearray(loopcounter)) to get the
string "DaleB" (without the quotes of course) is there a built-in VB function to
just grab the whole string from the array in one gulp, something like
Namestring=ByteArray(), but that actually works! <g>

Thanks for your interest and help.

Dale

.



Relevant Pages

  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)
  • Newbie: Array of pointers to strings questions.
    ... What I'm trying to do is extract information from one file and insert ... and the information in each case is extracted as a string. ... the relevant file is read into a temp file, ... but handling the array was a problem. ...
    (comp.lang.c)
  • Re: Performance Question
    ... Split is more efficient than actually looping through the string. ... second time (parsing it yet again) to assign the data to the array. ...
    (microsoft.public.vb.general.discussion)
  • Re: Function returns Datatype Mismatch
    ... >> Public Function Extract(Account_Code As String) As String ... Tokens is an array of strings, ... > Extract = Tokens ... > Tokensyields "A" ...
    (microsoft.public.access.modulesdaovba)
  • Re: Function returns Datatype Mismatch
    ... > Public Function Extract(Account_Code As String) As String ... Tokens is an array of strings, ... Extract = Tokens ... Tokensyields "A" ...
    (microsoft.public.access.modulesdaovba)