search

Home  >  Q&A  >  body text

How to convert "" to null?

For example, a="", how to convert it into a=null, which is used to transfer values ​​​​through the interface. "" cannot be used, only null can be used, but the value of the option object without value obtained by using select is "", please tell me How to solve?

我想大声告诉你我想大声告诉你2735 days ago954

reply all(5)I'll reply

  • 怪我咯

    怪我咯2017-06-17 09:17:40

    var a='';
    //传之前
    a=a||null;

    reply
    0
  • 阿神

    阿神2017-06-17 09:17:40

    a===""&&(a=null)

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-06-17 09:17:40

    var a="";
    a=a===""?null:a;

    reply
    0
  • 某草草

    某草草2017-06-17 09:17:40

    a===""&&(a=null)

    reply
    0
  • PHP中文网

    PHP中文网2017-06-17 09:17:40

    Use select(CASE WHEN(a = '') THEN null ELSE a END) AS a from...This way, you can refer to the article http://blog.csdn.net/qq_16990...

    reply
    0
  • Cancelreply