Advertisement

04.03.2008 at 01:58AM PDT, ID: 23292051
[x]
Attachment Details

VB.net string - trim string after certain instance of character

Asked by rwallacej in Microsoft Visual Basic.Net

Tags: microsoft, vb.net

Hi
This follows on a bit from question ID 21389189 (but may not need to use it)

I have a string of "errors" which can get rather long.  

If number of vbcrlf > 5 I want to trim the string - it has to be displayed on a messagebox so line upon line of vbcrlf is too big.

So, the string  is called allErrors and I want to trim it after 5 vbcrlf, instead of displaying full string , allerrors should only display up to the 5th vbcrlf and end with "too many errors to display"
Using ID 21389189 code,
if CountChars(allErrors, vbcrlf) > 5        'this is how question ID 21389189 counts number of times a character appears
'delete the text after the 5th vbcrlf        'what goes here?
end if

Thanks for helpStart Free Trial
 
 
Loading Advertisement...
 
[+][-]04.03.2008 at 02:33AM PDT, ID: 21270785

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: microsoft, vb.net
Sign Up Now!
Solution Provided By: jpaulino
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.03.2008 at 07:00AM PDT, ID: 21272724

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628