I have this code from JavaScript
function getURL(a, b) {
return ++b ? String.fromCharCode((a = a.charCodeAt() + 47, a > 126 ? a - 94 : a)) : decodeURIComponent(a).replace(/[^ ]/g, this.getURL);
}
A is an encoded URL so a String, B isn't even necessary to pass in, but it can be any String.
And I have to port it over to Java for Android Development. I just don't quite get how the ternary works with the return in this function. I thought the ternary means if(before?) {Stuff before colon} else {Stuff after colon}, but I don't understand how that works in combination with the return. If I understand that it shouldn't be hard to port it to Java