Click here to Skip to main content
14,121,894 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
HI All,

I have a code where i need to tuncate a sting to the length 50 . thanks
Posted
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Try:
Dim shorter As String = longString.SubString(0, 50)
   
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Use string functions like Substring, Length, Left
Also you can set max length for textboxes
   
Comments
Simon_Whale 24-Jun-11 10:44am
   
left function is one of the many legacy functions that have been brought over from the VB days

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190518.1 | Last Updated 24 Jun 2011
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100