1.8 KiB
1.8 KiB
replace-comments-x
Replace the comments in a string.
Version: 2.0.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
module.exports(string, [replacement]) ⇒ string ⏏
This method replaces comments in a string.
Kind: Exported function
Returns: string - The new string with the comments replaced.
Throws:
TypeErrorIf string is null or undefined or not coercible.TypeErrorIf replacement is not coercible.
| Param | Type | Description |
|---|---|---|
| string | string |
The string to be stripped. |
| [replacement] | string |
The string to be used as a replacement. |
Example
var replaceComments = require('replace-comments-x');
replaceComments(test;/* test * /, ''), // 'test;'
replaceComments(test; // test, ''), // 'test;'