function subString(str, len, hasDot) { var newLength = 0; var newStr = ""; var chineseRegex = /[^\x00-\xff]/g; var singleChar = ""; var strLength = str.replace(chineseRegex,"**").length; for(var i = 0;i < strLength;i++) { singleChar = str.charAt(i).toString(); if(singleChar.match(chineseRegex) != null) { newLength += 2; } else { newLength++; } if(newLength > len) { break; } newStr += singleChar; } if(hasDot && strLength > len) { newStr += "..."; } return newStr; } var questionListStr = ''; var myStr = ''; myStr = '如何面对情况特殊的同学,以及自己做的对吗(2/2)'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-06-08'; questionListStr = questionListStr + '浏览13次
  • '; myStr = '什么事情都很顺利但还是不开心'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-05-30'; questionListStr = questionListStr + '浏览33次
  • '; myStr = '被导师延毕该怎么疏解心情?'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-04-25'; questionListStr = questionListStr + '浏览64次
  • '; myStr = '情绪'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-04-19'; questionListStr = questionListStr + '浏览67次
  • '; myStr = '我很想和一个人认真道歉,但没有机会了'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-01-15'; questionListStr = questionListStr + '浏览461次
  • '; $('.zxzx ul').html(questionListStr);