html - Javascript- How to store string by searching for first couple letters -
I have a question about how to store a string in JavaScript, when you know only the first two letters here an example is. The HTML code is:
& lt; HTML & gt; & Lt; HEAD & gt; & Lt; TITLE & gt; Your title goes here & lt; / TITLE & gt; & Lt; / HEAD> & Lt; Body BGCOLOR = "FFFFF" & gt; & Lt; Center & gt; & Lt; IMG SRC = "cloud.jpg" ALIGN = "BOTTOM" & gt; & Lt; / Center & gt; & Lt; Human Resources & gt; & Lt; A href = "http://somegreatsite.com" & gt; Link Name & lt; / A & gt; There is a link to another nifty site & lt; H1 & gt; This is a header & lt; / H1> & Lt; H2 & gt; This is a medium header & lt; / H2> Me & lt; A href = "mailto: support@yourcompany.com" & gt; Send mail to support@yourcompany.com< / A & gt; & Lt; P & gt; This is a new paragraph! & Lt; A href = "/ 003U0000015 Armada" & gt; Person's Name / A & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; B & gt; This is a new paragraph! & Lt; / B & gt; & Lt; / P & gt; & Lt; BR & gt; & Lt; B & gt; & Lt; I & gt; This is a new sentence without paragraph break in bold italic. & Lt; / I & gt; & Lt; / B & gt; & Lt; Human Resources & gt; & Lt; / Body & gt; & Lt; / Html & gt; I need to store the full string of <003U0000015Rmza ', but I'll only know that it starts with' 003 '. Is there a way in Javascript to search for '003' characters, and once found, store the full string in a variable?
Thanks in advance!
You want a way to see if a string starts with a certain pattern
Look at
Comments
Post a Comment