1
string
str
=
"
127.0.0.1
"
;
2 str = str.Substring( 0 ,str.LastIndexOf( " . " ) + 1 ) + " * " ;
2 str = str.Substring( 0 ,str.LastIndexOf( " . " ) + 1 ) + " * " ;
这样显示的结果是:127.0.0.*
如果从数据库里取出来绑定在空间上,可以这样写
1
<%
# Eval(
"
userIP
"
).ToString().Substring(
0
,Eval(
"
userIP
"
).ToString().LastIndexOf(
"
.
"
)
+
1
)
+
"
*
"
%>