A string problem..
-
Actually i am doing a program in JSFL(Flash Javascript).So i posted the thread here and it's a basic problem. Suppose, string = 'welcome to moni\'s homepage' var i = string.indexOf("\'"); var j = string.indexOf("\'",j); valueOfString = string.substring(i+1, j); now valueOfString is welcome to moni but i need to return it as welcome to moni's homepage. What should i do?Thanks
-
Actually i am doing a program in JSFL(Flash Javascript).So i posted the thread here and it's a basic problem. Suppose, string = 'welcome to moni\'s homepage' var i = string.indexOf("\'"); var j = string.indexOf("\'",j); valueOfString = string.substring(i+1, j); now valueOfString is welcome to moni but i need to return it as welcome to moni's homepage. What should i do?Thanks
You need a replace function, not a substring function. Probably string.replace("\", "") Jeff Martin My Blog
-
Actually i am doing a program in JSFL(Flash Javascript).So i posted the thread here and it's a basic problem. Suppose, string = 'welcome to moni\'s homepage' var i = string.indexOf("\'"); var j = string.indexOf("\'",j); valueOfString = string.substring(i+1, j); now valueOfString is welcome to moni but i need to return it as welcome to moni's homepage. What should i do?Thanks
Monisankar wrote: Actually i am doing a program in JSFL(Flash Javascript).So i posted the thread here and it's a basic problem. Suppose, string = 'welcome to moni\'s homepage' var i = string.indexOf("\'"); var j = string.indexOf("\'",j); valueOfString = string.substring(i+1, j); now valueOfString is welcome to moni but i need to return it as welcome to moni's homepage. What should i do?Thanks As said, in the previous reply to your question you either need a replace method, or you need to add on the end of the string to the current one. Ie. valueOfString = string.substring(i+1,j) + string.substring(j+1,stringLength) I don't know what the string length function in JSFL though... _____________________ Don't take out the Magic Pen, Don't draw on the Infinity Board - Neil Young
-
Monisankar wrote: Actually i am doing a program in JSFL(Flash Javascript).So i posted the thread here and it's a basic problem. Suppose, string = 'welcome to moni\'s homepage' var i = string.indexOf("\'"); var j = string.indexOf("\'",j); valueOfString = string.substring(i+1, j); now valueOfString is welcome to moni but i need to return it as welcome to moni's homepage. What should i do?Thanks As said, in the previous reply to your question you either need a replace method, or you need to add on the end of the string to the current one. Ie. valueOfString = string.substring(i+1,j) + string.substring(j+1,stringLength) I don't know what the string length function in JSFL though... _____________________ Don't take out the Magic Pen, Don't draw on the Infinity Board - Neil Young
Thanks to both of u. Got it and solved. Thanks