Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function extractCapitalCaseWords(text) {
- let arr = text[0].split(/[^A-Za-z]+/).filter(w => w.length > 0);
- let result = [];
- for(let i = 0; i < arr.length; i++){
- let currentWord = arr[i];
- let wordInCapitals = currentWord.toUpperCase();
- if(currentWord == wordInCapitals){
- result.push(currentWord);
- }
- }
- console.log(result.join(', '));
- }
- let text = ['We start by HTML, CSS, JavaScript, JSON and REST.\n' +
- 'Later we touch some PHP, MySQL and SQL.\n' +
- 'Later we play with C#, EF, SQL Server and ASP.NET MVC.\n' +
- 'Finally, we touch some Java, Hibernate and Spring.MVC.\n'];
- extractCapitalCaseWords(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement