如何在键入时格式化并验证每个4位数之间带有空格的信用卡号:
eg: 4464 6846 4354 3564
Run Code Online (Sandbox Code Playgroud)
我试过了:
$('.creditno').keyup(function() {
cc = $(this).val().split("-").join("");
cc = cc.match(new RegExp('.{1,4}$|.{1,4}', 'g')).join("-");
$(this).val(cc);
});
Run Code Online (Sandbox Code Playgroud)
请帮忙
我在我的localhost中安装最新版本的nodejs.但系统总是安装4.2.6版本.如何安装最新版本.
我用过的命令:
sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install nodejs
Run Code Online (Sandbox Code Playgroud)
安装完毕后我检查过:
node -v
Run Code Online (Sandbox Code Playgroud)
结果:
v4.2.6
Run Code Online (Sandbox Code Playgroud)
产量apt-cache policy nodejs:
Installed: 4.2.6~dfsg-1ubuntu4
Candidate: 4.2.6~dfsg-1ubuntu4
Version table:
*** 4.2.6~dfsg-1ubuntu4 500
500 http://archive.ubuntu.com/ubuntu xenial/universe amd64
Packages
100 /var/lib/dpkg/status
Run Code Online (Sandbox Code Playgroud)
要么
任何人都可以发送安装的安装步骤
node-v8.2.1-linux-x64.tar.xz
Run Code Online (Sandbox Code Playgroud)
文件.
谢谢
如何使用 php prophecy 指定函数的返回类型(接口的实例)。
方法是这样的:-
class classname()
{
public $var;
public functionName : Interface
{
return $this->var;
}
}
Run Code Online (Sandbox Code Playgroud)
可以做这样的事情吗?$this->method->willreturn(string)->ofTypeInterface
php ×2
html ×1
javascript ×1
node.js ×1
phpunit ×1
prophecy ×1
ubuntu-16.04 ×1
unit-testing ×1