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 = '和导师沟通'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-07-02'; questionListStr = questionListStr + '浏览98次
  • '; myStr = '恐惧亲密关系(3)'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-07-01'; questionListStr = questionListStr + '浏览83次
  • '; myStr = '如何面对情况特殊的同学,以及自己做的对吗(2/2)'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-06-08'; questionListStr = questionListStr + '浏览62次
  • '; myStr = '什么事情都很顺利但还是不开心'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-05-30'; questionListStr = questionListStr + '浏览61次
  • '; myStr = '被导师延毕该怎么疏解心情?'; questionListStr = questionListStr + '
  • '; questionListStr = questionListStr + '' + subString(myStr, 40, true) + ''; questionListStr = questionListStr + '2025-04-25'; questionListStr = questionListStr + '浏览138次
  • '; $('.zxzx ul').html(questionListStr);