[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

split in web application

Posted on 2016-09-02
7
Medium Priority
?
17 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 45

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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

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 45

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

830 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