Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

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
0
xizor
Asked:
xizor
1 Solution
 
mladenoviczCommented:
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now