I came up with this kind of RegExp:
var rg = /(^\w{1}|\.\s*\w{1})/gi;
var myString = "hi all, this is derp. thank you all to answer my query.";
myString = myString.replace(rg, function(toReplace) {
return toReplace.toUpperCase();
});
More Related Contents:
- How do I check if an element is hidden in jQuery?
- How can I convert this from jQuery to standard javascript?
- Get palindrome length from string [closed]
- Graphical bar presentation using jquery [closed]
- Store Dropdown list old values and re populate them
- What’s the difference between ‘$(this)’ and ‘this’?
- Detect element content changes with jQuery
- How can I select an element by name with jQuery?
- jQuery disable/enable submit button
- Binding arrow keys in JS/jQuery
- jQuery object and DOM element
- Is there a way to return a list of all the image file names from a folder using only Javascript?
- Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser
- How to get the containing form of an input?
- jquery, find div class name at a certain position while scrolling
- Javascript/jQuery: Set Values (Selection) in a multiple Select
- How do I use jQuery’s form.serialize but exclude empty fields
- How to format a phone number with jQuery
- How to dynamic filter options of with jQuery?
- How to detect a click inside of an iframe (cross-domain)? Aka prevent click fraud
- How do I verify jQuery AJAX events with Jasmine?
- Get an array of list element contents in jQuery
- Paint algorithm leaving white pixels at the edges when I color [duplicate]
- get parent.location.url – iframe – from child to parent
- regular expression to validate datetime format (MM/DD/YYYY) [duplicate]
- ToolTip is not closing with Select2
- many elements of a listbox to another
- how to select all class except the clicked element in JQuery?
- jQuery form submit() is not working in IE6?
- Can you have multiple lines in an element?