获得前50个字符 [英] get first 50 characters

查看:88
本文介绍了获得前50个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个长度为100个字符的字符串,我需要获得前50个字符,如何在VB中使用


我还没有多年来用VB编写,我忘记了它的语法。


I have a string that is 100 characters long, I need to get the first 50, How
can I do that in VB?
I haven''t coded in VB in years and I forget the syntax for it.


推荐答案

ShortString = LongString.SubString(0, 50)

" John" < CS ******* @ gmail.com>在消息中写道

新闻:O4 ************** @ TK2MSFTNGP02.phx.gbl ...
ShortString = LongString.SubString(0,50)
"John" <CS*******@gmail.com> wrote in message
news:O4**************@TK2MSFTNGP02.phx.gbl...
我有一个字符串是100个字符长,我需要得到前50个,
我怎么能在VB中做到这一点?
多年来我没有在VB中编码而且我忘记了它的语法。
I have a string that is 100 characters long, I need to get the first 50,
How can I do that in VB?
I haven''t coded in VB in years and I forget the syntax for it.



您可以尝试几种不同的方式:


Mid(strString,1,50)

Strings.Left(strString,50)


是一对......


Cory

John写道:
There are a few different ways you can try:

Mid(strString, 1, 50)
Strings.Left(strString, 50)

are a couple...

Cory

John wrote:
我有一个长度为100个字符的字符串,我需要获得前50个,如何在VB中执行此操作?
多年来我还没有用VB编写代码而忘记了它的语法。
I have a string that is 100 characters long, I need to get the first 50, How
can I do that in VB?
I haven''t coded in VB in years and I forget the syntax for it.






" John" < CS ******* @ gmail.com> schrieb:
"John" <CS*******@gmail.com> schrieb:
我有一个长度为100个字符的字符串,我需要获得前50个字符,
如何在VB中执行此操作?
我没有编码多年来我在VB中忘记了它的语法。
I have a string that is 100 characters long, I need to get the first 50,
How can I do that in VB?
I haven''t coded in VB in years and I forget the syntax for it.




我更喜欢''左(str,50)''。


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://classicvb.org/petition/>



I prefer ''Left(str, 50)''.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


这篇关于获得前50个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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