Created
July 14, 2011 18:07
-
-
Save jorgeguberte/1083013 to your computer and use it in GitHub Desktop.
trimTitle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var simpleTitle = "Google+"; | |
var titleWithCount = "(5) Google+"; | |
var titleWithName = "Jorge Guberte - Google+"; | |
var complexTitle = "(5) Jorge Guberte - Google+"; | |
getTrimmedTitle = function(){ | |
var title = $("title").text(); | |
if(parseInt(title.indexOf(')'))>0){ | |
return title.slice(4); | |
}else{ | |
return title; | |
} | |
}; | |
var titulo = getTrimmedTitle(); | |
console.log(titulo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment