Question: I'd like to write a simple C# app to collect the output of a Zebra printer's magnetic card reader. (Model RW420) My only interface to the device is USB. The CPCL language specifies an `MCR` command for this purpose, but I cannot figure out how to issue this command to the printer via .NET. Neither the online documentation nor support staff can tell me. Does anyone have an idea?

Answer: 
```
"thisStringIsGood"
    // insert a space before all caps
    .replace(/([A-Z])/g, ' $1')
    // uppercase the first character
    .replace(/^./, function(str){ return str.toUpperCase(); })

```

displays 

```
This String Is Good

```

```js
(function() {

  const textbox = document.querySelector('#textbox')
  const result = document.querySelector('#result')
  function split() {
      result.innerText = textbox.value
        // insert a space before all caps
        .replace(/([A-Z])/g, ' $1')
        // uppercase the first character
        .replace(/^./, (str) => str.toUpperCase())
    };

  textbox.addEventListener('input', split);
  split();
}());
```

```css
#result {
  margin-top: 1em;
  padding: .5em;
  background: #eee;
  white-space: pre;
}
```

```html
<div>
  Text to split
  <input id="textbox" value="thisStringIsGood" />
</div>

<div id="result"></div>
```
[Lodash](https://lodash.com/docs/4.17.5#startCase) handles this nicely with `_.startCase()`