我需要使用vb.net从字符串开始50个单词 [英] I Need to get starting 50 words from a string using vb.net

查看:66
本文介绍了我需要使用vb.net从字符串开始50个单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以字符格式从数据库中检索一些产品信息,我只需显示该信息的50个字。

I am retrieving some product information from database in character format & i need to display only starting 50 words of that information..

推荐答案

查看Substring函数。



http://www.dotnetperls.com/substring-vbnet [ ^ ]



所有你需要的是 yourstring.Substring(0,50);
Look into the Substring function.

http://www.dotnetperls.com/substring-vbnet[^]

All you need to to is yourstring.Substring(0, 50);


我已经解决了这个我自己使用以下代码:



Dim Bkdesc as String



Bkdesc = RsProdesc(概述 )

Bkdesc = Bkdesc.Substring(0,200)

Dim LsI As Integer

LsI = Bkdesc.LastIndexOf()

Bkdesc = Bkdesc.Substring(0,LsI)



谢谢你们所有人..
I have solved this myself by using following code:

Dim Bkdesc as String

Bkdesc = RsProdesc("Overview")
Bkdesc = Bkdesc.Substring(0,200)
Dim LsI As Integer
LsI = Bkdesc.LastIndexOf(" ")
Bkdesc = Bkdesc.Substring(0, LsI)

& Thanks all of you..


通常你会实现50个字符的限制从数据库中检索产品信息时。

由于您还没有告诉我们您使用的数据库系统,我们无法帮您完成此操作。



要在VB.NET中执行此操作,请查看功能。

它可以让你显示一定数量的字符。
Usually you would implement the 50 character limitation when retrieving the product information from your database.
As you haven't told us what database system you are using, we can't help you do this.

To do this in VB.NET, have a look at the Left function.
It will enable you to display on a certain amount of characters.


这篇关于我需要使用vb.net从字符串开始50个单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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