StringTrimRight

首页  后退  前进

StringTrimRight
down2

StringTrimRight

删除字符串右起指定数量的字符.

 

StringTrimRight ( "string", count )

参数

string

目标字符串.

count

删除的字符数.

返回值

返回删除右起指定数量字符后的字符串.

备注

若给定的" 数量 "参数值越界, 则返回一个空字符串.

StringTrimRight($str, $n) 相当于 StringLeft($str, StringLen($str) - $n)

 

函数示例

#include <MsgBoxConstants.au3>
Local $sString = StringTrimRight("This is a sentence with whitespace.", 5) ; Remove the 5 rightmost characters from the string.
MsgBox($MB_SYSTEMMODAL, "", $sString)

----------------------------------------

 

该函数可以通过命令 exect 调用

参见:

StringTrimLeft, StringLeft, StringRight, StringLen, StringMid, StringInStr

例子
copy
StringTrimRight('Это~~字符串',3)

 

exect=$var_s1=StringTrimRight('~~это~~字符串~~текста~~',3)||$var_s2=StringTrimRight('~~это~~字符串~~текста~~',8) GLOBALEXECT<a> ;; 删除指定数量的字符串字符到右边

 

exect=$var_put=StringTrimRight('"%P"',1) lists=PS<$var_put\images//1//0> ;; 传递活动面板的路径而没有反斜杠的示例

 

exect=$var_put=##@[tc=AP]||$var_put=StringTrimRight('$var_put',1)||_ViewValues('$var_put') ;; 使用参数a [tc]传递没有反斜杠的活动面板路径的示例

 

exect=$var_put=##@[tc=AP]||$var_put=StringTrimRight('$var_put',1) xends=-1||formt<56,54,51> rends=GLOBALXENDS<1>??1||formt<lin131,63,56,54,51> rends=GLOBALXENDS<1>??2||formt<lin133,63,56,54,51> sends=#GLOBALRENDS<1>\\4||formt<serch48,lin132,lin135,1,63,56,54,51> sends=#GLOBALRENDS<2>\\4!!2||formt<serch49,lin132,lin134,lin135,1,63,56,54,51> zends=GLOBALSENDS<t1,2>??-1 GLOBALZENDS<c> creat=$var_put||Youtube-list-GLOBALXENDS<1>-@<info=s47>.txt||content<$GLOBALZENDS>||empty<1> ;; 在活动面板中创建列表,链接到的YouTube上的所有播放列表和播放列表,其名称(例如,Thoisoi)在剪贴板上的用户将该列表复制到剪贴板

 

exect=$var_put=##@[tc=AP]||$var_put=StringTrimRight('$var_put',1) movee=<xfolder=51//$f45>||$var_put//0 slist=GLOBALMOVEE1<t1>||test<1e!!zip> <IF> <info=f401GLOBALSLIST<1>//> < 2 AND <info=f402GLOBALSLIST<1>//> < 1 <THEN> zunpf=GLOBALSLIST<1>||$var_put//0 delsm=GLOBALZUNPF0<1>||1||upd<1> <ELSE> zunpf=GLOBALSLIST<1>||$var_put//0||foldname<1> delsm=GLOBALZUNPF0<1>||1||upd<1> <ENDIF> ;; 将最后的归档文件从文件夹c:\Users\name\Downloads和如果移动到活动面板,然后将其压缩,然后将其解压缩到命名目录中,或者根据条件

exect=$var_put=##@[tc=AP]||$var_put=StringTrimRight('$var_put',1) sends=-1!!-1||formt<54,1,63,6> slist=$GLOBALSENDS||#Hcrc32|1|1 downl=$var_put//9||$GLOBALSENDS||convert<##<listx=$GLOBALSLIST>\;;$$file-rndm[3-|8].;;$$@@e71::>||uformat<0>||owrite<2|1>||pause<1-2>||progres<> ;; 从哈希crc32形式的链接值下载从缓冲区到创建的文件夹的链接列表,在具有随机名称的活动面板中

up2

tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru