c# - How to divide series of names into different rows -


i have list of name in series like:

1.wrobel/teresa   2.wrobel/marek 

now want show these name in grid this

  • wrobel/teresa
  • wrobel/marek

and on dont want number , . grid.

how can using asp.net4.0 web application

for example have string this:

t-                                                                               fxp/r,u                                                                           1.wrobel/teresa   2.wrobel/marek                                               1   ord lh  433 k 28aug 1015p ok kknc2n   cn10   28aug28aug 1pc                  2 x fra lh 1378 k 29aug  405p ok kknc2n   cn10   29aug29aug 1pc                  3 o gdn lo  359 w 15sep  800a ok kknc2n   cn10   15sep15sep 1pc                  4 x fra lh  432 k 15sep  530p ok kknc2n   cn10   15sep15sep 1pc                  ord                                                                          fare  u usd     174.00                                                            tx001 x usd   541.00yqac tx002 x usd     5.50ycae tx003 x usd    17.20usap        tx004 x usd    17.20usas tx005 x usd     5.00xaco tx006 x usd     7.00xycr        tx007 x usd     2.50ayse tx008 x usd    51.08raeb tx009 x usd    17.16dese        tx010 x usd     0.22ndad tx011 x usd    14.78xwae tx012 x usd     4.50xf          total   usd     857.14                                                            grand total usd     857.14                                                        chi lh x/fra lh gdn86.85kknc2n/cn10 lo x/fra lh chi86.85kknc2n/                   cn10 nuc173.70end roe1.000000 xf ord4.5                                            55.fe refthruag/nonend/nonrerte/lh/ua/ac/os/sn/lx -bg:lh                   

59.fm *m*0
60.fp check
";

now create function use coding part this:

public class detail {     string output;     datatable dt = new datatable();     datarow dr = null;      public datatable getdetail(list<string> request, list<string> request)      {             string item = data;             dr = dt.newrow();             regex regex1 = new regex(@"(fxp\s{3,20})|(\r\s{3}.\s+(.+))", regexoptions.ignorecase | regexoptions.compiled);             foreach (match m in regex1.matches(data))             {                 output = m.tostring();             }                dr["passenger name"] = output;              }             return dt;             }      } 

in result in same row below screenshot enter image description here

in 2nd row 2 name want each name in different row this

enter image description here

but not number , .

thanks in advance

i don't understand regex works far i've tested:

regex regex1 = new regex(@"(?<=\d\.)([^\s]*)(?=\s)"); 

or use:

regex.split(string, @"\s*\d\.\s*"); 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -