截断变量 [英] Truncating Variables

查看:127
本文介绍了截断变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有内置函数可以用来截断变量更长的时间
超过30个字符?更好的是,是否有一个截断的函数和

然后追加(...)到底?


-


谢谢,

Jason Williard

Is there a built-in function that I can use to truncate variables longer
than 30 characters? Even better, is there a function that truncates and
then appends "(...)" to the end?

--

Thank You,
Jason Williard

推荐答案

>是否有一个内置函数可以用来截断变量
> Is there a built-in function that I can use to truncate variables longer
超过30个字符?更好的是,是否存在截断的功能,然后附加(...)。到底?
than 30 characters? Even better, is there a function that truncates and
then appends "(...)" to the end?




你问的是如何修剪一个字符串?如果是这样,你可以这样做:


dim sourceString as string

dim truncatedString as string

truncatedString = left(sourceString, 30)& ...


-Darrel



Are you asking how to trim a string? If so, you could do this:

dim sourceString as string
dim truncatedString as string
truncatedString = left(sourceString, 30) & "..."

-Darrel


Darrel,

这几乎是我想要的。但是,对于附加(...),

,对于超过30个字符的字符串需要做什么,

不是所有字符串都超过30个字符?


-


谢谢,

Jason Williard
客户服务

PCSafe,Inc。

darrel <无***** @ hotmail.com>在消息中写道

news:Ow ************** @ TK2MSFTNGP10.phx.gbl ...
Darrel,

This is pretty much what I wanted. However, for the appending of "(...)",
what would it take to do that to strings that are more than 30 characters,
as not all strings are more than 30 chars?

--

Thank You,
Jason Williard
Client Services
PCSafe, Inc.
"darrel" <no*****@hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
是否有一个内置函数可以用来截断长度超过30个字符的变量?更好的是,是否存在截断的功能,然后附加(...)。到底?
Is there a built-in function that I can use to truncate variables longer
than 30 characters? Even better, is there a function that truncates and
then appends "(...)" to the end?



你问的是如何修剪一个字符串?如果是这样,你可以这样做:

dim sourceString as string
dim truncatedString as string
truncatedString = left(sourceString,30)& ...

-Darrel



Are you asking how to trim a string? If so, you could do this:

dim sourceString as string
dim truncatedString as string
truncatedString = left(sourceString, 30) & "..."

-Darrel



所以只需检查字符串是否结束30个字符。如果不是,

保持不变,否则对其进行转换。


Jason Williard < JA ******** @ gmail.com>在消息中写道

新闻:IlVbd.396828
So just check to see if the string is over 30 characters. If it is not,
leave it as is, otherwise perform this transformation on it.

"Jason Williard" <ja********@gmail.com> wrote in message
news:IlVbd.396828


这篇关于截断变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆