split the message into array
RadikalGenc.aspx?phonenumber=5552451245&message=ISTAN-ALL-123;Emly,Foz,Praia,Sol,Luna,Trabalha
string number = Request.QueryString["phonenumber"].ToString();
string textMessage = Request.QueryString["message"].ToString();
I need the textMessage splitted int array Like this:
ISTAN-AL开发者_运维技巧L-123 -> Presents Form name The list below, presents the fiels name
- Emly
- Foz
- Praia
- Sol
- Luna
- Trabalha
how can do that?
Try this (assuming that you're sure that will always be the format and that none of the values will ever contain one of the separators (;
or ,
):
textMessage.Split(';')[1].Split(',')
You can split the message variable two times. The first time by ISTAN-ALL-123;
which will get you Emly,Foz,Praia,Sol,Luna,Trabalha
and then perform another split by ','
String.Split
Something like this
string[] messageArray = Request.QueryString["message"].Split(';');
string formName = messageArray[0];
string[] fieldArray = messageArray[1].Split(',');
精彩评论