Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. $scope.parseTitle = function (value) {
  2. if (!value) { return; }
  3. var result = value
  4. .replace(/_([a-zA-Z])/g, " $1").split(' ').map(d => d.charAt(0).toUpperCase() + d.slice(1)).join(' ')
  5. .replace(/([A-Z])/g, " $1");
  6. return result;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement