removing unwanted data from a string

I am using the following code to read some information from the registry:

nbufferdata = Space(256)
RegOpenKey LOCALMACHINE, MainKey, nBufferKey
RegOpenKey nBufferKey, SubKey, nBufferSubKey
RegQueryValueEx nBufferSubKey, Item, 0, REG_SZ, nbufferdata, Len(nbufferdata)


it works fine, but nbufferdata contains a lot of characters that are not part of the information read from the registry.

I know there's a simple procuedure to remove these but cant think of what it is, can anyone help??

Cheers,

`Andy
LVL 2
xizorAsked:
Who is Participating?
 
mladenoviczConnect With a Mentor Commented:
nbufferdata= Left$(nbufferdata, InStr(1, nbufferdata, Chr$(0)) - 1)
0
 
JR2003Commented:
nbufferdata = Left$(nbufferdata , InStr(1, nbufferdata, Chr$(0)) - 1)
0
 
craigewensCommented:
Replace(expression, find, replacewith[, start[, count[, compare]]])
0
 
xizorAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.