Solved

split in web application

Posted on 2016-09-02
7
14 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 

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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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