Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# split quotation

string myString = "WordOne "Word Two"";
var result = myString.Split('"')
                     .Select((element, index) => index % 2 == 0  // If even index
                                           ? element.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)  // Split the item
                                           : new string[] { element })  // Keep the entire item
                     .SelectMany(element => element).ToList();

Console.WriteLine(result[0]);
Console.WriteLine(result[1]);
Console.ReadKey();
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to add gravity without rb in unity 
Csharp :: Create a button in unity to show ad 
Csharp :: web client ignore ssl error 
Csharp :: how to round to nearest number in array c# 
Csharp :: cant find desktop and documents folder macOs 
Csharp :: c# enum get string value 
Csharp :: how to call an If statement only once in C# 
Csharp :: Create Text File and Write 
Csharp :: Unity upload image to project 
Csharp :: unity audiosource play 
Csharp :: how to stream video from vlc in c# 
Csharp :: unity vector3 initialization 
Csharp :: Response.Redirect cannot be called in a Page callback 
Csharp :: c# file to byte array 
Csharp :: c# response.contenttype set filename 
Csharp :: Popup open close wpf 
Csharp :: display image script unity 
Csharp :: convert rgb to float 
Csharp :: c# faker 
Csharp :: list cast< c# 
Csharp :: c# read file stream 
Csharp :: How can I use Hex color Unity? , give hex color in unity 
Csharp :: excel rows count 
Csharp :: c# copy an object 
Csharp :: exception 
Csharp :: calculate textbox value c# 
Csharp :: set time on audio source unity 
Csharp :: c# check multiple variables for null 
Csharp :: camera follow player unity 
Csharp :: How to return a list to view after foreach in c# 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =