Reputation: 21
Can somebody help me create the following regular expression:
Example
Source: This is my document - version 2 Result: ThisIsMyDocumentVersion2
Thanks,
Upvotes: 0
Views: 348
Reputation: 26201
This is probably your regexp
var stc = "This is my document - version 2",
result = stc.replace(/[^\w]+(\w)/g, (m,n) => n.toUpperCase());
Upvotes: 0