如何判断输入内容是空格?

chido 2003-03-20 02:47:55
如何才能判断出输入内容是空格?
我说的是不论是几个空格,一个,两个,多个,只要
内容全是空格,就提示出来。
...全文
41 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
freeprogramer 2003-03-20
  • 打赏
  • 举报
回复
在数据窗口的itemchanged 事件中判断不是很方便吗
chido 2003-03-20
  • 打赏
  • 举报
回复
恩,csdsjkk() 的方法比第一有效的多。
chido 2003-03-20
  • 打赏
  • 举报
回复
想在DataWindow输入时用,这样是不是会很麻烦?每条数据必须取出去来,调用这样一个函数判断一下,再继续。在DataWindow里有没有比较好的属性设置,或者有效判断设置来解决这个问题。
csdsjkk 2003-03-20
  • 打赏
  • 举报
回复
if trim(ls_string) = '' and len(ls_string) > 0 then
Thinkinger 2003-03-20
  • 打赏
  • 举报
回复
用一个循环语句就行
string ls_string //字符串内容
integer li_len //字符串长度
boolean lb_entrystring=true //是否全是空格字符的串

ls_string=sle_1.text
li_len=len(ls_string)
if li_len>0 then
for i=1 to li_len
if mid(ls_string,i,1)<>' ' then
lb_entrystring=false
exit
end if
next
end if

if lb_entrystring=true then
........
else
........
end if

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧