Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want split text below:
}xxxix,{ †‡ƒ«. :›¢øñ

How can I split text between characters '{' and '}' and other text?

I use generic.
This text is dynamic

Please help me.
Posted
Updated 4-May-11 22:15pm
v3
Comments
Sandeep Mewara 5-May-11 2:50am    
Split as in? Is string.Split not doing what you want?
Dalek Dave 5-May-11 4:15am    
Edited for Grammar.
Sergey Alexandrovich Kryukov 5-May-11 17:27pm    
What does it mean "No"? You did not get the idea. And you did not specify how you want to split, even on the example. Have my 1!
--SA
OriginalGriff 6-May-11 4:09am    
"variable1 store text between tow char"
What is a "tow character"? - please reply via the "Add comment" below the solution, rather than posting an answer - that way the relevant person gets an email.

Why dont you try like that

string ss = "}xxxix,{ †‡ƒ«. :›¢øñ";
          char[] c = { '}', '{' };
          ss.Split(c);
 
Share this answer
 
Comments
Dalek Dave 5-May-11 4:14am    
Simple!
Sergey Alexandrovich Kryukov 5-May-11 17:28pm    
OP commented (removed from "Solution"):

No
i want split and store into 2 variable list .
variable1 store text between tow char
and variable2 store text out tow char.
I wouldn't use a regex, just String.Split twice:
string text = "›¢øñ}xxxix,{ †‡ƒ«. :›¢øñ";
string[] withoutClose = text.Split('}');
if (withoutClose.Length == 2)
    {
    string[] withoutOpen = withoutClose[1].Split('{');
    if (withoutOpen.Length == 2)
        {
        string start = withoutClose[0];
        string middle = withoutOpen[0];
        string end = withoutOpen[1];
        }
    }
 
Share this answer
 
Comments
Dalek Dave 5-May-11 4:14am    
Better!
Sergey Alexandrovich Kryukov 5-May-11 17:28pm    
OP commented (removed from "Solution"):

No
i want split and store into 2 variable list .
variable1 store text between tow char
and variable2 store text out tow char.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900