会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
oosumu
懒鬼,门外汉
博客园
首页
新随笔
联系
订阅
管理
公告
some function
public
bool
isnumeric(
string
str)
{
char
[] ch
=
new
char
[str.Length];
ch
=
str.ToCharArray();
for
(
int
i
=
0
;i
<
ch.Length;i
++
)
{
if
(ch[i]
<
48
||
ch[i]
>
57
)
return
false
;
}
return
true
;
}
public
string
coder(
string
source)
{
if
(source
!=
string
.Empty
&&
source
!=
null
)
{
source
=
source.Replace(
"
<
"
,
"
<<
"
);
source
=
source.Replace(
"
>
"
,
"
>>
"
);
source
=
source.Replace(
"
\r\n
"
,
"
<br/>
"
);
source
=
source.Replace(
"
\n
"
,
"
<br/>
"
);
source
=
source.Replace(
"
"
,
"
 
"
);
return
source;
}
else
{
return
source;
}
}
public
bool
IsNumeric(
string
s,
out
double
result)
{
bool
bReturn
=
true
;
try
{
result
=
double
.Parse(s);
}
catch
{
result
=
0
;
bReturn
=
false
;
}
return
bReturn;
}
public
int
IsNumeric(
string
str)
{
int
i;
if
(str
!=
null
&&
Regex.IsMatch(str,
@"
^\d+$
"
))
i
=
int
.Parse(str);
else
i
=
-
1
;
return
i;
}
posted on
2005-01-12 21:15
- -
阅读(
770
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
Powered by:
博客园
Copyright © 2024 - -
Powered by .NET 8.0 on Kubernetes