one of the best ways to deal with things like lists is to iterate over them with the each method, which keeps an index that you can use to operate on elements according to their position:
Code:
$(".ui-tabs-nav li").each(function (idx) {
if (idx != 3) {
$(this).remove()
} else {
$(this).text("whatever")
}
});