This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 请教 在DOT NET 里字符串处理的一个问题?有没有相应的函数处理字符串 类式于下面的MyPtrintf函数
MyPrintStr(strBuffer,"select * from table1 where sex='%s' and
age>%d", "Femal",25);
那么strBuffer 为 select * from table where sex='Femal' and age>'25
-bobo123(bobo);
2004-10-1
{219}
(#1911944@0)
-
Console.Write("select * from table1 where sex='{0}' and age>{1}", "Female",25);
-hillxie(阳光、绿地、鸽子);
2004-10-1
(#1911957@0)
-
这个是往CONSOLE 输出,有没有办法把结果送给 STRING 对象
-bobo123(bobo);
2004-10-1
(#1911972@0)
-
string x = "select * from table1 where sex='{0}' and age>{1}";
string y = String.Format(x, "Female", 25);
-hillxie(阳光、绿地、鸽子);
2004-10-1
(#1911991@0)
-
非常的感谢
-bobo123(bobo);
2004-10-1
(#1912004@0)
-
no ke qi.
-hillxie(阳光、绿地、鸽子);
2004-10-1
(#1912015@0)