如何总是在 50 个字符后拆分变量中的文本?
所以仅在 50 个字符后拆分为新行
set length [::textutil::adjust $text -length 50 -strictlength true]
问候
编辑:
输入是变量 $Plot 中的文本
LaRochelle, a former pirate captain, is caught by the British. To get his
ship back, he works as a spy against other pirates, first of all Blackbeard
and Providence. He works on some ships, crossing the Caribbean sea, with the
intention
set pieces [regexp -all -inline {.{1,50}} $Plot]
set 0 [lindex [lindex $pieces 0] 0]
set 1 [lindex [lindex $pieces 1] 1]
putnow "PRIVMSG $channel :$0"
输出只有:
<testbot> LaRochelle,
<testbot> British.
可惜没有了。。