RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:9:30-18:00
你可能遇到了下面的问题
关闭右侧工具栏
Limit Title Character...
  • 作者:xiaoxiao
  • 发表时间:2020-12-23 11:02
  • 来源:未知

<%Function neatTrim( strToTrim, desiredLength )strToTrim = trim( strToTrim )

if len( strToTrim ) < desiredLength then

neatTrim = strToTrim

exit function

else

if inStrRev( strToTrim, " ", desiredLength ) = 0 then

strToTrim = left( strToTrim, desiredLength - 1 ) & "&#133;"

else

strToTrim = left( strToTrim, inStrRev( strToTrim, " ", desiredLength + 1 ) -1 ) & "&#133;" 'no carriage return here

end if

end if

neatTrim = trim( strToTrim )

End Function

strLong = " This string is too long! "

strTrimmed = NeatTrim( strLong, 13 )

response.write( strTrimmed )%>