vb中Trim(Right(Left(ValueOfString, End_Pos), End_Pos - begin_Pos + 1))什么意思
发布网友
发布时间:2022-05-16 10:52
我来回答
共1个回答
热心网友
时间:2023-10-20 07:52
Trim(Right(Left(ValueOfString, End_Pos), End_Pos - begin_Pos + 1))
Right(Left(ValueOfString, End_Pos), End_Pos - begin_Pos + 1)
Left(ValueOfString, End_Pos)
a=Left(ValueOfString, End_Pos),a的值为在ValueOfString中从左边数End_Pos个字符,比如ValueOfString=" abcdef ghijklmnopqrstuvwxyz",End_Pos=8,a的值就是" abcdef "
b=Right(a,End_Pos - begin_Pos + 1),b的值为在a中从边数(End_Pos - begin_Pos + 1)个字符,假设begin_Pos=3,那么(End_Pos - begin_Pos + 1)=8-3+1=6,b=Right(a,6)=Right(" abcdef ",6)="bcdef "
c=trim(b),c的值就是b去掉两端的空格之后的值,c=trim("bcdef ")="bcdef"