[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

split in web application

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

 

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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

656 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