2012-05-19 69 views
0

我想更換بازي到بازی用linq中的字母替換字母ي?

var List = (from darkhast in Tbl_Darkhast.Where(d => d.Address.Replace("ی","ي").StartsWith(Address.Replace("ی","ي") )) 
       select new 
       { 
        .... 
       } 
+1

我想有一些問題,或者您不會將它作爲問題發佈... 它是什麼? – Guffa

+0

爲什麼你更換它,而不是搜索?其實只有你關心的第一個人 – Aristos

+0

你能解釋一下,你正在努力完成什麼? –

回答

0

結果=>

var List =(來自darkhast in Tbl_Darkhast.W這裏(d => d.Name_Moteghazi.Replace(「」,「」).Replace(「ي」,「ی」)。替換(「ك」,「ک」)。StartsWith(NameMoteghazi.Replace(「」, 「).Replace(」ي「,」ی「)。替換(」ك「,」ک「)))

   select new 
       { 
        Shomare_Darkhast = darkhast.Shomare_Darkhast, 
        Tarikhe_Darkhast = darkhast.Tarikhe_Darkhast, 
        Sharhe_NoeDarkhast = darkhast.TBL_NoeDarkhast.Sharhe_NoeDarkhast, 
        Mantaghe = darkhast.Mantaghe, 
        Hoze = darkhast.Hoze, 
        Block = darkhast.Block, 
        Melk = darkhast.Melk, 


       }); 
    return (ObjectQuery)List; 
2

我認爲,你應該選擇查詢寫

var List = (from darkhast in Tbl_Darkhast)) 
       select new Tbl_Darkhast 
          { 
          Address= darkhast.Address.Replace("ی","ي") 
          ,Name = darkhast.Name 
          }; 
+0

這是錯的嗎?替換(替換(malek.NameNameKhanevadegie_Malek,'',''),'ی','ي')像@NameNameKhanevadegie_Malek「是不是錯誤? –

0

的距離和字符排量:

var List = (from darkhast in Tbl_Darkhast.Where(d => d.Address.Replace(" ", "").Replace("ي", "ی").Replace("ك", "ک").StartsWith(Address.Replace(" ", "").Replace("ي", "ی").Replace("ك", "ک"))) 
select new 
{ 
    ....strong text 
}