tag:blogger.com,1999:blog-6082652835152798567.post6362330565068781313..comments2024-03-28T00:58:12.736-07:00Comments on Sql server, .net and c# video tutorial: Strings in JavaScriptUnknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6082652835152798567.post-37554948545639779542019-07-08T03:10:54.131-07:002019-07-08T03:10:54.131-07:00Hi Venkat,
In recent interview i have faced one q...Hi Venkat,<br /><br />In recent interview i have faced one question which i could not answer. The questions is what is the difference between below two lines of code.<br /><br />var name = "Kud Venkat";<br />var anothername = new String("Kud Venkat");<br /><br />Can you please explain me, what is the difference between them. Thanks in advance.<br />Harshahttps://www.blogger.com/profile/02503257620111336561noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-15132370518099422232017-09-16T05:15:56.588-07:002017-09-16T05:15:56.588-07:00var myString = "A Blue bottle with a blue liq...var myString = "A Blue bottle with a blue liquid is on a blue table";<br />var name='blue';<br />var result = myString.replace(/'name'/g, "green");<br />alert(result);Anonymoushttps://www.blogger.com/profile/17158660975778086271noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-44756192780201098512015-11-12T14:14:21.637-08:002015-11-12T14:14:21.637-08:00For special characters which has special meaning i...For special characters which has special meaning in javascript like single quote ,double quote and forward slash(/).if you want to treat them as regular printable characters then we can make use of the escape sequences(\). <br /><br />you can handle the forward slash / with the help of backslash \.use the back slash before the forward slash to treat it as string<br />for example<br />var url ="This is google Url http://www.google.com and yahoo URL http://www.yahoo.com"<br /><br />We have above string and we want to replace the http:// with Hello.<br /> document.write(url.replace(/http:\/\//gi,"Hello"))<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-67423189813155150072014-11-08T05:50:30.289-08:002014-11-08T05:50:30.289-08:00Venkat,
Could you please help me in this replace ...Venkat,<br /><br />Could you please help me in this replace scenario?<br />In this tutorial you said we can replace a word with /blue/g. In case of dynamic http tag, how could we replace a url string with desired word? for example I have a string that starts with https://...... . This entire url string I want to replace with say Hello world. How can I extract the entire url string starting from https:// and end with unknown as it is dynamic. <br /><br />The url could be http://www.google.com or http://www.pragim.com or could be any other unknown text. Anonymousnoreply@blogger.com