Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to capitalize a letter based on an index in javascript

function capitalize(s,arr){
  s = s.split("");
  for(var i = 0; i < arr.length; i++){
    if (s[arr[i]] == null) { continue }
    s[arr[i]]=s[arr[i]].toUpperCase();  
  }
  s = s.join('');
  return s;
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: js keydown only once 
Javascript :: string split javascript newline 
Javascript :: string remove accents 
Javascript :: javascript template strings 
Javascript :: socket.io with express 
Javascript :: require("history").createBrowserHistory` instead of `require("history/createBrowserHistory")` 
Javascript :: how to make jtextarea scrollable 
Javascript :: firebase storage javascript delete document 
Javascript :: toggle classname onclick react 
Javascript :: react chart chart title 
Javascript :: javascript round to nearest 10 
Javascript :: get date javascript format 
Javascript :: get element font size javascript 
Javascript :: generate 50 random numbers between 1 and 500 in javascript 
Javascript :: javascript for loop infinite 
Javascript :: generate component with module angular 8 
Javascript :: window vue remove event listener 
Javascript :: package.json tilde vs caret 
Javascript :: express bodyparser deprecated 
Javascript :: resize image react native 
Javascript :: how to get date using tolocaledatestring 
Javascript :: get element by 
Javascript :: es6 create array of multiples 
Javascript :: jquery ajax form submission 
Javascript :: angular create guard 
Javascript :: convert json string to json object in java 
Javascript :: javascript check if string is number 
Javascript :: first duplicate javascript 
Javascript :: javascript get a random array from 1 to n 
Javascript :: jquery keep scroll position 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =