-1

I need to remove the "ML" portion of "ML 11/07" but I want to keep the numbers as well as the slash.

Here is my current code (Google Apps Script)

var sec=second.replace("[^\\d.]", "");
tss.getRange(counter2, 5).setValue(sec); 
brk
  • 48,835
  • 10
  • 56
  • 78
Louis
  • 1
  • 1

2 Answers2

0

You can use RegExp /[a-z]/ig, .trim()

var sec = second.replace(/[a-z]/ig, "").trim();
guest271314
  • 1
  • 15
  • 104
  • 177
0

you can do this.

var string = "ML 11/07"
var result = string.split(" ");

console.log(result[1]);
Rafi Ud Daula Refat
  • 2,187
  • 19
  • 28