Home > Net >  Using string function inside google sheet script
Using string function inside google sheet script

Time:10-01

I can’t find tutorials on that help me find functions to extract substring from string and length of a string. Thank you Stefano

CodePudding user response:

May be these links could help you. If not, give some examples in a spreadsheet.

length

substring

slice

CodePudding user response:

Well you can use the MDN website to search for those but here is what you asked for :

extract substring from string

The substring() method returns the part of the string between the start and end indexes, or to the end of the string.

const str = 'Stephano';

console.log(str.substring(1, 3));
// "te"
console.log(str.substring(2));
// "ephano"

length of a string

The length property of a String object contains the length of the string :

let string = "This is text !"
console.log(string.length)
// 14
  • Related