Solved

split in web application

Posted on 2016-09-02
7
9 Views
Last Modified: 2016-09-06
value ="Employee1, Boutros William Ton,Partner, Employee2, "
value .Split(New Char() {", "}, StringSplitOptions.RemoveEmptyEntries)
return  5 output instead 3 why???
0
Comment
Question by:pamela rizk
  • 5
  • 2
7 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41781191
You are saying split on the following characters, and there are two different ones, split on a comma or split on an space ' '.
As I said in your earlier question to split on the string ", " you need to specify to the split function that it is a string, not a character, you want to split on.

value .Split(New String() {", "}, StringSplitOptions.RemoveEmptyEntries)
0
 

Author Comment

by:pamela rizk
ID: 41781194
in my string value ="Employee1, Boutros William Ton,Partner, Employee2, "
values are separated by ", "
comma and space

how to split comma and space ina way to have 3 as outputtt????
0
 

Author Comment

by:pamela rizk
ID: 41781197
event when doing value.split(", ") it is giving 5 outputsss??
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Accepted Solution

by:
pamela rizk earned 0 total points
ID: 41781202
it is solved using  Dim lines() As String
        lines = Regex.Split(k, chars)
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41781211
Did you do what I suggested.  It does work.
SNAG-0020.bmp
1
 

Author Comment

by:pamela rizk
ID: 41781328
yes it is working so both solution are correct
0
 

Author Closing Comment

by:pamela rizk
ID: 41785804
Dim lines() As String
        lines = Regex.Split(k, chars)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now