0

我有一个数据类型为数字的列,但存在一个非整数值“[”我想在 pentaho 中使用 javascript 删除它。我已经尝试过这个脚本。有人可以帮忙吗?

var abc = <column_name>.replace(/\D/g,'');
4

2 回答 2

0

试试这个代码。但我还没有测试。

  String str = "a12.334tyz.78x";
  str = str.replaceAll("[^\\d.]", "");
于 2016-04-29T09:12:54.547 回答
0

try using this var abc = <column_name>.replace(/[^0-9]/g,'') this will return you only string of numbers and than you can parse it to integer.

于 2016-04-29T09:49:34.607 回答