You do not crop anything, when you use innerTextString.substr(0)
, as it has the same amount of characters like the original String.
var e = "ThisisaText";
var t = e.substring(0);
Log.v("e", e);
Log.v("t", t);
Output:
"ThisisaText"
"ThisisaText"
additionally you select the Items via classname. So I recommend, you crop all Items with the same class to provide consistency.
Try this code:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="prettyFileList">| Testsize</div>
</body>
<script>
var c = document.getElementsByClassName('prettyFileList');
for (var i = 0; i < c.length; ++i) {
var item = c[i];
item.innerHTML = item.innerHTML.substr(1);
}
</script>
</html>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…