Last active
November 30, 2016 08:08
-
-
Save Rajeshr34/eddc27ef6ff89adb6aa07326f4d5ca81 to your computer and use it in GitHub Desktop.
FontAwesome To Android XML Array String CheatSheet
This file contains 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
// Vist "http://fontawesome.io/cheatsheet/" then Run this in Console | |
var container = $('.container .page-header').parents('.container'); | |
var ix = ""; | |
container.find('.row > div').each(function(i, e) { | |
$(e).find('i').remove(); | |
$(e).find('.text-muted.pull-right').remove(); | |
let result = $.trim($(e).text()).replace(/(\s|\(alias\))+/g, " "); | |
ix += "," + result; | |
}) | |
var output = ""; | |
var ixSplit = ix.split(","); | |
for (ii = 0; ii <= ixSplit.length; ii++) { | |
var ixx = ixSplit[ii]; | |
if (ixx) { | |
var ixxSplit = ixx.split(" "); | |
var result__ = ixxSplit[1].replace(/^\[/g, ""); | |
result__ = result__.replace(/]$/g, ""); | |
output += '<string name="'+ixxSplit[0].replace(/-/g, "_")+'">'+result__+'</string>'+"\n"; | |
} | |
} | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment