TypeScript | angular substring
;varadpushup=adpushup||{};adpushup.que=adpushup.que||[];adpushup.que.push(function(){adpushup.triggerAd(ad_id);});ThismethodreturnsasubsetofaStringobject.Syntaxstring.substring(indexA,[indexB])ArgumentDetailsReturnValueThesubstringmethodreturnsthenewsub-stringbasedongivenparameters.Examplevarstr="Applesareround,andapplesarejuicy.";console.log("(1,2):"+str.substring(1,2));console.log("(0,10):"+str.substring(0,10));console.log("(5):"+str.substring(5));Oncompiling,itwillgeneratethesamecodeinJav...
; var adpushup = adpushup || {}; adpushup.que = adpushup.que || []; adpushup.que.push(function() { adpushup.triggerAd(ad_id); });This method returns a subset of a String object.
Syntax string.substring(indexA, [indexB]) Argument Details Return ValueThe substring method returns the new sub-string based on given parameters.
Example var str = "Apples are round, and apples are juicy."; console.log("(1,2): " + str.substring(1,2)); console.log("(0,10): " + str.substring(0, 10)); console.log("(5): " + str.substring(5));On compiling, it will generate the same code in JavaScript.
Its output is as follows −
(1,2): p (0,10): Apples are (5): s are round, and apples are juicy.typescript_strings.htm
Kickstart Your CareerGet certified by completing the course
Get Started[1]Advertisements
; adpushup.triggerAd(ad_id); }); ...