Jump to content

[SOLVED] code issue 0 -1


purencool

Recommended Posts

Hi phpfreaks

 

This code should either find a . anywhere in the string to return nothing. Else  add . to the end.  I can not get it to work. Can any one see why?

thanks purencool

           
var mores =  win.search(/./)
            alert(mores)
          if( mores != -1 || 0){
                var returnValue = win;
            }else{
                returnValue = (win += ".") ;
            }
            return returnValue;

Link to comment
https://forums.phpfreaks.com/topic/178704-solved-code-issue-0-1/
Share on other sites

You were right thanks I don't  what I was thinking when I wrote that.

But my issue was the regex and full stop. This fixed it.

 

            var mores =  win.search(/[.]/);
            if( mores != -1){
                var returnValue = win;
            }else{
                returnValue = (win += ".") ;
            }
            return returnValue;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.