Linked Questions
35 questions linked to/from Split a string by another string in C#
0
votes
3
answers
8k
views
How to split a string by multiple chars? [duplicate]
I have a string like this: string ip = "192.168.10.30 | SomeName".
I want to split it by the | (including the spaces. With this code it is not possible unfortunately:
string[] address = ip.Split(new ...
-6
votes
1
answer
4k
views
Split string into two separate strings [duplicate]
I have a name that is just one string for example "LUKE CARROLL" and I want to split this string into first name and last name. So I just need to split the string where there is a space.
So I would ...
0
votes
6
answers
1k
views
How to Split at word not at a char in c# [duplicate]
How do I split a string at word not at a char, Like
I want to split this string into an array of strings:
Hello /*End*/ World /*End*/ Bye /*End*/ live /*End*/
I want to split at /*End*/
so the ...
0
votes
1
answer
292
views
How to split/extract complex string data c# [duplicate]
In this scenario the data I could have in my string may look like below but keep in mind the ids are dynamically generated so this isn't static and could be more than 2 if you haven't caught onto that....
1
vote
1
answer
140
views
Split a string on whitespace AND a char followed by whitespace again [duplicate]
I need to split a string describing a soccer match into home team and away team.
The string will always be something like "Manchester United v Liverpool".
I need to split on ' v ' - i know that - I ...
-1
votes
2
answers
119
views
How can I removed the rest of string after a particular string/pattern? [duplicate]
Does anyone know how can I removed the rest of string after a particular string or pattern?
For example:
I save the html code into a string as below:
String test;
test = '<html xmlns="http://...
0
votes
1
answer
124
views
How can I break up the text after the # I shared in the image? [duplicate]
I will create a parametric structure
I will take after each '#' with its extension.
For example here I need to get two texts after #
-7
votes
4
answers
238
views
Splitting of words Dynamically in c# [duplicate]
I am creating a project in which i want to group the words dynamically
previously i Split and grouped them as static
if i need to insert (1 100000888888888 4949494949 17032 HYB DR 25-May-2000 ...
1
vote
0
answers
65
views
I am newbie in C#. I have a string "mkt_tag" and I want output as "Mkt Tag" using C#. Can anyone help me out [duplicate]
I am writing C# codes for Tabular Editor. I have a string Like "mkt_tag" and want to convert it into "Mkt Tag". I wrote this code but still have some problems. Please help me to ...
200
votes
6
answers
311k
views
string.split - by multiple character delimiter
i am having trouble splitting a string in c# with a delimiter of "][".
For example the string "abc][rfd][5][,][."
Should yield an array containing;
abc
rfd
5
,
.
But I cannot seem to get it to ...
3
votes
3
answers
4k
views
Split string with multiple separators in C#
I am having trouble splitting a string in C# with a delimiters && and ||.
For example the string could look like:
"(abc)&&(rfd)&&(5)||(hh)&&(nn)||(iu)"
Code:
string[]...
2
votes
4
answers
4k
views
How to convert text file to XML
I have a .txt file and i want to convert it into .xml file using c#. The txt file looks like
a/b/c
a/b
a/b/c/d
e
OUTPUT:
<root>
<a>
<b>
<c>
<d></d>
...
0
votes
3
answers
4k
views
Extracting URL from string
Assume my string is
http://www.test.com\r\nhttp://www.hello.com<some text here>http://www.world.com
I want to extract all URLs in the string. The output should be as follows:
http://www.test....
2
votes
1
answer
2k
views
How to get the full string element of a dicom item with fo-dicom?
I'm trying to get a string of a radiation therapy plan in a dicom file with fo-dicom. Doesn't seem to be that hard for you, but I'm stucking because I cannot find the right command.
I was filtering ...
2
votes
4
answers
1k
views
Sort list by price c#
I'm trying to sort a list based on the price for each item in the list.
Here's what I want my output to look like:
ROLLS_ROYCE1 -- 6.608 €
ROLLS_ROYCE3 -- 4.956 €
...