//title :字符串 ;interceptLength:所需的长度
function TitleThumbnail(title, interceptLength, thumbnailCharacter) {
if (!interceptLength) {
interceptLength = 16;
}
if (!thumbnailCharacter) {
thumbnailCharacter = "..";
}
return CharacterThumbnail(title, interceptLength, thumbnailCharacter);
}
function CharacterThumbnail(originString, interceptLength, thumbnailCharacter) {
if (originString == null || originString=="") {
return "";
}
if (interceptLength <= 0) {
return originString;
}
else if (originString.length <= interceptLength) {
return originString;
}
else {
return originString.substring(0, interceptLength) + thumbnailCharacter;
}
}