Home > Back-end >  Check String equality of Slide textbox
Check String equality of Slide textbox

Time:10-16

I'm using SlidesApp.getActivePresentation.getSlides[0].getPageElements()[0].asShape().getText().asString() to get the text of the title of the slide. However, when I try to check the text in an equality statement like SlidesApp.getActivePresentation.getSlides[0].getPageElements()[0].asShape().getText().asString() == "XYZ Company" it returns false. What do I need to do to accurately check that a given Slide page element textbox contains certain text?

CodePudding user response:

It seems the type of textbox was adding a trailing line break, so s.getPageElements()[0].asShape().getText().asString() == "XYZ Company" String.fromCharCode(10) evaluates true

CodePudding user response:

Alternative Solution:

You can also try using the enter image description here

  • Related