phorcon3 Posted February 14, 2008 Share Posted February 14, 2008 i have the following html output: (value1) what javascript function would i have to use, to get the string within the brackets? so, it will output: value1 function whatever(str) { var string = str.some_function(); } Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 14, 2008 Share Posted February 14, 2008 function whatever(str){ var string = str.substring(1,str.length-1); } Quote Link to comment Share on other sites More sharing options...
phorcon3 Posted February 14, 2008 Author Share Posted February 14, 2008 thanks, lol ..theres just one more problem (value1) isnt the acutal output, it would look somewhat like this: random_string1 (value1)<br /><em>random_string2</em> Quote Link to comment Share on other sites More sharing options...
nogray Posted February 14, 2008 Share Posted February 14, 2008 function whatever(str){ var string = str.substring(str.indexOf("(")+1,str.indexOf(")")); } Quote Link to comment Share on other sites More sharing options...
phorcon3 Posted February 14, 2008 Author Share Posted February 14, 2008 thanks a bunch!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.