Need some help - function that strips html tags

Hey peeps,
Need some guidance.
I need help to write a function that will strip html tags from a string. So for examples if I have the following string:
myString = "<p>This is a Paragraph</p>"; after runing the function it should return the string: "This is a Paragraph".
Could anyone plz point me in the right direction on how to do this.
Thanks,
Zub

System.out.println(myString.replaceAll("<[^>]++>\\s*", ""));

Similar Messages

  • Oracle function to strip HTML tags in data

    Hi, may I know if there is any oracle function that can strip HTML tags from the data? I am currently using Oracle 9i. Therefore is unable to use the RegExp_Replace functionality provided by Oracle 10g.
    Any help will be appreciated.
    Thanks a lot!

    I found this function:
    function str_html ( line in varchar2 ) return
    varchar2 is
    x varchar2(32767) := null;Let's hope whoever uses this doesn't want to deal with large XML's.
    This question would have been better asked over in the XDB forum. All depends whether there is a schema available to describe the XML, what version of the database etc. With a schema, the schema could be registered into the Oracle 10g database and that used to create relational tables automatically, from where you can load in the XML files. Loads of information available on the XDB forum, most likely in the FAQ's on there.

  • Need some help with cfoutput and a tag

    hey there,
    got meself into some issues with <a> and <cfoutput> tags.
    Problem:
    myResult = <a href="http://www.mysite.co.uk" rel="nofollow">mysite</a>
    <cfoutput>#myResult#</cfoutput> outputs "<a href="http://www.mysite.co.uk" rel="nofollow">mysite</a>" (surprise isn't it?)
    now is there any way to output it as html so it would display a link to "mysite"???
    cheers,
    Simon

    thanks!
    I've missed the fact that it was xml data. Just added .xmlText at the end and that sorted my problems. However I'll write down cfsavecontent solution for the future reference.
    cheers,
    Simon

  • Need some help with Tab Strip

    Hello Experts,
    I have a got a scenario where I have 4 option button on the page & Tabstrip having 4 tabs below that.
    Based on the options he chooses I need to make those tabs visible or invisible.
    Can any one of you suggest me how can I do it.
    PS:
    I tried creating a Value attribute with Boolean as a type & assigned it to the Visibility of the Tab.
    This think works but the problem is after selecting the options the tabs are collapsed on each other..so user cant see it unless he goes onto the navigation & choose the appropriate one.
    Thanks in advance.

    Hi,
    Create an string type attribute as selectedTab and bind it to the SelectedTab property of the TabStrip.
    In the action of your option button, set the name / id of tab that you want to display in the selectedTab attribute so that the tab gets displayed
    Lets the tabs are Tab1, Tab2, Tab3 and Tab4. Now on a button click you want Tab3 to be displayed then on the action of button write the code as
    wdContext.currentContextElement().setselectedTab('Tab3');
    Regards,
    Amol

  • Need some help with a remove function

    Design and code a program that will maintain a list of product names. Use a String type to represent the product name and an array of strings to implement the list. Your program must implement the following methods:
    Add a product to the list
    Remove a product from the list
    Display then entire list
    Find out if a particular product is on the list.
    You need to create a command command loop with a menu() function. The program must continue asking for input until the user stops.
    This is the assignment and this is what I have so far. I need some help writing the remove function.
    Thanks
    * Title: SimpleSearchableList.java
    * Description: this example will show a reasonably efficient and
    * simple algorithm for rearranging the value in an array
    * in ascending order.
    public class SimpleSearchableList {
         private static String[] List = new String[25]; //These variables (field variables)
         private static int Size; //are common to the entire class, but unavailable
         //except to the methods of the class...
         public static void main(String[] args)
              String Cmd;
              for(;;) {
                   Menu();
                   System.out.print("Command: ");
                   Cmd = SimpleIO.inputString();
                   if(Cmd.equals("Quit"))
                        break;
                   else if(Cmd.equals("Fill"))
                        FillList();
                   else if(Cmd.equals("Search"))
                        SearchList();
                   else if(Cmd.equals("Show"))
                        ShowList();
                   else if(Cmd.equals("Remove"))
                        Remove();
         //Tells you what you can do...
         public static void Menu()
              System.out.println("Choices..................................");
              System.out.println("\tFill to Enter Product");
              System.out.println("\tShow to Show Products");
              System.out.println("\tSearch to Search for Product");
              System.out.println("\tRemove a Product");
              System.out.println("\tQuit");
              System.out.println(".........................................");
         //This method will allow the user to fill an array with values...
         public static void FillList()
              int Count;
              System.out.println("Type Stop to Stop");
              for(Count = 0 ; Count < List.length ; Count++)
                   System.out.print("Enter Product: ");
                   List[Count] = SimpleIO.inputString();
                   if(List[Count].equals("Stop"))
                        break;
              Size = Count;
         //This method will rearrange the values in the array so that
         // go from smallest to largest (ascending) order...
         public static void SearchList()
              String KeyValue;
              boolean NotFoundFlag;
              int Z;
              System.out.println("Enter Product Names Below, Stop To Quit");
              while(true)
                   System.out.print("Enter: ");
                   KeyValue = SimpleIO.inputString();
                   if(KeyValue.equals("Stop")) //Note the use of a method for testing
                        break; // for equality...
                   NotFoundFlag = true; //We'll assume the negative
                   for(Z = 0 ; Z < Size ; Z++)
                        if(List[Z].equals(KeyValue)) {
                             NotFoundFlag = false; //If we fine the name, we'll reset the flag
              System.out.println(List[Z] + " was found");
                   if(NotFoundFlag)
                        System.out.println(KeyValue + " was not found");     
         //This method will display the contents of the array...
         public static void ShowList()
              int Z;
              for(Z = 0 ; Z < Size ; Z++)
                   System.out.println("Product " + (Z+1) + " = " + List[Z]);
         public static void Remove()
    }

    I need help removing a product from the arrayYes. So what's your problem?
    "Doctor, I need help."
    "What's wrong?"
    "I need help!"
    Great.
    By the way, you can't remove anything from an array. You'll have to copy the remaining stuff into a new one, or maybe maintain a list of "empty" slots. Or null the slots and handle that. The first way will be the easiest though.

  • We have a set of oracle clients running on T5220 zones that need some help

    Greetings all -
    We have a set of oracle clients running on T5220 zones that need some help.
    If, for example, I execute the query "select (all) from dba_objects", trace output reports 90% of the elapsed time spent under "SQLNet message from client".
    Here are OS details for the clients: Solaris 10 5/08 s10s_u5wos_10 SPARC
    Running "uname -a" from the client gives:
    (SunOS bmc-ste-app 5.10 Generic_127127-11 sun4v sparc SUNW,SPARC-Enterprise-T5220)
    Here are OS details for the dataserver: Enterprise Linux Enterprise Linux Server release 5.2
    Running "uname -a" from the dataserver gives:
    (2.6.18-92.1.6.0.2.el5 #1 SMP Thu Jun 26 17:44:55 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux)
    The RDBMS is 10.2.0.4
    Again, please note, there is no application in the picture here. We are just running a simple catalog query (select * from dba_objects) from sqlplus. Why the wait on something like this? The wait also occurs when a different query is used (select (all) from SYS.COL$ where rownum < 50000). And it doesn't matter if I used the full client or the instant client. I still get the same high-wait.
    We had thought - maybe this is a network thing - so we put a test client on the same subnet as the dataserver. This helped - but not enough. The wait is still way too high even with firewalls taken out of the equation.
    We've also looked at arraysize, SDU, kernel settings. And we've spent time going over tkprof, truss and sqlnet-tracing.
    Has anyone ever had to solve this HIGH WAIT ON CLIENT issue? Is there a work around or some tweak I'm missing.
    Is anyone configured like we are (linux dataserver, solaris clients)? If so - did you see anything like this?
    tia -
    Jim
    Edited by: jim1768 on Mar 31, 2010 1:47 PM
    Edited by: jim1768 on Mar 31, 2010 2:12 PM
    Edited by: jim1768 on Mar 31, 2010 2:13 PM

    Hello,
    We have the exact same issue. Did you ever solve this issue? We have a t5220 and have just upgraded our 11.5.10.2 11i system on it from 9.2.0.8 32-bit sparc to 11.2.0.1 64-bit sparc. Things should be faster but arent, and our consultant has tracked it down to high wait times when the apps tier using forms connects to the database tier on the same box. So even though the t5220 is both server and client, there is something about the client sql connection.through TNS that his having trouble. Thanks for any information. We've also created an S/R with Oracle.
    Note: I am well aware of the other issues with the CMT server series but this particular issue seems independent of the regular / known issues and remains a mystery to us. Other known issues with the CMT servers for SPARC:
    Metalink Note 781763.1 (Migration from fast single threaded CPU machine to CMT UltraSPARC T1 & T2)
    http://blogs.sun.com/glennf/resource/Optimizing_Oracle_CMT_v1.pdf
    http://blogs.sun.com/glennf/tags/throughput
    http://blogs.sun.com/glennf/entry/getting_past_go_with_sparc
    http://www.oracle.com/apps_benchmark/doc/E-Bus-11i-PAY_ORA_SUN-T5220.pdf (this paper has some oracle init settings at the end. The kernel settings have been included in the OS upgrade)
    http://blogs.sun.com/mandalika/entry/siebel_on_sun_cmt_hardware

  • I need some help uninstalling Acrobat 8 that did not completly install because of I believe my Windo

    I need some help removing, uninstalling Adobe Acrobat 8 that did not completely install because of I believe my computers operating system Windows 7 Ultimate.  I purchased Adobe Acrobat XI and it will not install until I remove the old Adobe Acrobat 8.

    Hi Wzachare,
    http://helpx.adobe.com/acrobat/kb/manually-remove-acrobat-8-windows.html may help.
    Thanks!
    Eshant

  • Need some help in saving video message from viber to my Iphone. I disabled the thing that would save photos and videos automatically then, there comes a video I want to save. After loading and watching it, I press the "save to gallery"

    Need some help in saving video message from viber to my Iphone 5S with new ios 8's program . I disabled the thing that would save photos and videos automatically then, there comes a video I want to save. After loading and watching it, I press the "save to gallery" thing but it doesn't save in gallery. I tried all, restarting my phone, rebooting then turning on the save automatically thing and when I watch it again, it still wouldn't save.

    Probably a good question to ask Viber or look at their support site.

  • Hi! I got movies on my external hard drive that are AVI kind and won't play on my macbook pro? need some help please!!

    Hi! I got Movies on my external hard drive that are AVI kind and won't play on my macbook pro? When I start playing the movie a message pops up and says "a required codec is not available". I tried flip4mac, xvid, divx already and still not playing my video. need some help please!! thanks.

    Although vlc mentioned above is a much more powerful and better player you could try installing Perian if you insist on using the quicktime player.  It may supply the codec it needs.
    Not sure why you wouldn't be able to play straight avi files though in quicktime.

  • Need some help to unlock the Ipad. Cannot contact the previous owner he is in the shelter and I do not know were. After I restore the Ipad is asking that the previous owner has to remove it from his account

    need some help to unlock the Ipad. Cannot contact the previous owner he is in the shelter and I do not know were. After I restored the Ipad is asking that the previous owner has to remove it from his account

    Nobody on these boards or at Apple will unlock that device for you. Sorry.
    (117810)

  • Need some help here on the proper settings for quicktime exporting from imovie that won't degredate the footage from my handycam

    need some help here on the proper setting for quicktime exporting that won't denegrate my footage from handycam canon fs200

    What are the existing settings iMovie?
    Al

  • I am currently using an ipod touch 3. When i record in voice memos with the apple earphones(with an inbuilt mic) i can see on the screen that its recording; but when i hear it, its just a long beep. Need some help!

    I am currently using an ipod touch 3. When i record in voice memos with the apple earphones(with an inbuilt mic) i can see on the screen that its recording;
    but when i hear it, its just a long beep. Need some help!

    Does the mic work for other apps like Voice Control?
    Does the mic work OK in other devices?
    Have you tried it with another mic?
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    -  Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • HT1937 hello all....i need some help 2 can activate my 4s,i paid 4 unlock code and cant actvaite my phone ,the server support told me thats phone unlocked done.but apple server not say that..my imei 990001021636113

    hello all....i need some help 2 can activate my 4s,i paid 4 unlock code and cant actvaite my phone ,the server support told me thats phone unlocked done.but apple server not say that..my imei 990001021636113

    There is no such thing as an "unlock code" for an iPhone. It's done through iTunes after being approved by the carrier it is locked to.
    Go back to the carrier it is locked to and find out what the status is. If you paid someone else to unlock it, you got ripped off.

  • Need some help in creating Search Help for standard screen/field

    I need some help in adding a search-help to a standard screen-field.
    Transaction Code - PP01,
    Plan Version - Current Plan (PLVAR = '01'),
    Object Type - Position ( OTYPE = 'S'),
    Click on Infotype Name - Object ( Infotype 1000) and Create.
    I need to add search help to fields Object Abbr (P1000-SHORT) / Object Name (P1000-STEXT).
    I want to create one custom table with fields, Position Abb, Position Name, Job. Position Abb should be Primary Key. And when object type is Position (S), I should be able to press F4 for Object Abb/Object Name fields and should return Position Abbr and Position Name.
    I specify again, I have to add a new search help to standard screen/field and not to enhance it.
    This is HR specific transaction. If someone has done similar thing with some other transation, please let me know.
    There is no existing search help for these fields. If sm1 ever tried or has an idea how to add new search help to a standard screen/field.
    It's urgent.
    Thanks in advace. Suitable answers will be rewarded

    Hi Pradeep,
    Please have a look into the below site which might be useful
    Enhancing a Standard Search Help
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/daeda0d7-0701-0010-8caa-
    edc983384237
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm
    A search help exit is a function module for making the input help process described by the search help more flexible than possible with the standard version.
    This function module must have the same interface as function module F4IF_SHLP_EXIT_EXAMPLE. The search help exit may also have further optional parameters (in particular any EXPORTING parameters).
    A search help exit is called at certain timepoints in the input help process.
    Note: The source text and long documentation of the above-specified function module (including the long documentation about the parameters) contain information about using search help exits.
    Function modules are provided in the function library for operations that are frequently executed in search help exits. The names of these function modules begin with the prefix F4UT_. These function modules can either be used directly as search help exits or used within other search help exits. You can find precise instructions for use in the long documentation for the corresponding function module.
    During the input help process, a number of timepoints are defined that each define the beginning of an important operation of the input help process.
    If the input help process is defined with a search help having a search help exit, this search help exit is called at each of these timepoints. If required, the search help exit can also influence the process and even determine that the process should be continued at a different timepoint.
    timepoints
    The following timepoints are defined:
    1. SELONE
    Call before selecting an elementary search help. The possible elementary search helps are already in SHLP_TAB. This timepoint can be used in a search help exit of a collective search help to restrict the selection possibilities for the elementary search helps.
    Entries that are deleted from SHLP_TAB in this step are not offered in the elementary search help selection. If there is only one entry remaining in SHLP_TAB, the dialog box for selecting elementary search helps is skipped. You may not change the next timepoint.
    The timepoint is not accessed again if another elementary search help is to be selected during the dialog.
    2. PRESEL1
    After selecting an elementary search help. Table INTERFACE has not yet been copied to table SELOPT at this timepoint in the definition of the search help (type SHLP_DESCR_T). This means that you can still influence the attachment of the search help to the screen here. (Table INTERFACE contains the information about how the search help parameters are related to the screen fields).
    3. PRESEL
    Before sending the dialog box for restricting values. This timepoint is suitable for predefining the value restriction or for completely suppressing or copying the dialog.
    4. SELECT
    Before selecting the values. If you do not want the default selection, you should copy this timepoint with a search help exit. DISP should be set as the next timepoint.
    5. DISP
    Before displaying the hit list. This timepoint is suitable for restricting the values to be displayed, e.g. depending on authorizations.
    6. RETURN (usually as return value for the next timepoint)
    The RETURN timepoint should be returned as the next step if a single hit was selected in a search help exit.
    It can make sense to change the F4 flow at this timepoint if control of the process sequence of the Transaction should depend on the selected value (typical example: setting SET/GET parameters). However, you should note that the process will then depend on whether a value was entered manually or with an input help.
    7. RETTOP
    You only go to this timepoint if the input help is controlled by a collective search help. It directly follows the timepoint RETURN. The search help exit of the collective search help, however, is called at timepoint RETTOP.
    8. EXIT (only for return as next timepoint)
    The EXIT timepoint should be returned as the next step if the user had the opportunity to terminate the dialog within the search help exit.
    9. CREATE
    The CREATE timepoint is only accessed if the user selects the function "Create new values". This function is only available if field CUSTTAB of the control string CALLCONTROL was given a value not equal to SPACE earlier on.
    The name of the (customizing) table to be maintained is normally entered there. The next step returned after CREATE should be SELECT so that the newly entered value can be selected and then displayed.
    10. APP1, APP2, APP3
    If further pushbuttons are introduced in the hit list with function module F4UT_LIST_EXIT, these timepoints are introduced. They are accessed when the user presses the corresponding pushbutton.
    Note: If the F4 help is controlled by a collective search help, the search help exit of the collective search help is called at timepoints SELONE and RETTOP. (RETTOP only if the user selects a value.) At all other timepoints the search help exit of the selected elementary search help is called.
    If the F4 help is controlled by an elementary search help, timepoint RETTOP is not executed. The search help exit of the elementary search help is called at timepoint SELONE (at the
    F4IF_SHLP_EXIT_EXAMPLE
    This module has been created as an example for the interface and design of Search help exits in Search help.
    All the interface parameters defined here are mandatory for a function module to be used as a search help exit, because the calling program does not know which parameters are actually used internally.
    A search help exit is called repeatedly in connection with several
    events during the F4 process. The relevant step of the process is passed on in the CALLCONTROL step. If the module is intended to perform only a few modifications before the step, CALLCONTROL-STEP should remain unchanged.
    However, if the step is performed completely by the module, the following step must be returned in CALLCONTROL-STEP.
    The module must react with an immediate EXIT to all steps that it does not know or does not want to handle.
    Hope this info will help you.
    ***Reward points if found useful
    Regards,
    Naresh

  • Need some help after inserting CMS system

    Hi on my site ive inserted an CMS system from Cushy. It all work that isnt the problem. The problem is that my page is a mess now.. The only thing ive addes is a cms code so im hoping the solution isnt hard to do.
    There are three pages that are complete changed.
    The home page
    http://www.vakantiewoningeninsuriname.nl/index.html
    The text colomn right under is moved.How can i place this back?
    on http://www.dorff.nl/ you can see how it was before i add the CMS.
    The next page is:
    http://www.vakantiewoningeninsuriname.nl/bezienswaardighedenparamaribo.html
    You can see there is a lot extra space between the head and the text. And you see that the text is not only at the right side anymmore.
    This is how it should be:
    http://www.dorff.nl/bezienswaardighedenparamaribo.html
    The same goes for this page:
    http://www.vakantiewoningeninsuriname.nl/prijzen.html
    And this is how it have to be:
    http://www.dorff.nl/prijzen.html
    Hope you can help, thank you for looking..
    Regards Brian

    Dear Nancy,
    Thank you for your response,
    I will try to explain again what is wrong. On my site you see this page:
    http://www.vakantiewoningeninsuriname.nl/prijzen.html
    Problem is that the picture below is on the right side of the page instead of the left like the other pictures.
    On:
    http://www.dorff.nl/prijzen.html
    You can see how it should looks.. Pictures to the left and text on the right. Dont know what happened when im adding the Cuschy CMS. Hope you can see what is wrong.
    Regards Brian
    Date: Wed, 2 May 2012 13:04:14 -0600
    From: [email protected]
    To: [email protected]
    Subject: Need some help after inserting CMS system
        Re: Need some help after inserting CMS system
        created by Nancy O. in Dreamweaver - View the full discussion
    Change this:
    Prijzen
    Bij ons kunt u terecht met elk budget. Wij hebben woningen voor mensen die een langere tijd blijven maar ook voor vakantiegangers. Daarom hebben wij verschillende prijzen gehanteerd.
      to this: <!Begin CushyCMS>
    h2. Prijzen
    Bij ons kunt u terecht met elk budget. Wij hebben woningen voor mensen die een langere tijd blijven maar ook voor vakantiegangers. Daarom hebben wij verschillende prijzen gehanteerd.
    <!end CushyCMS>   Nancy O.Alt-Web Design & PublishingWeb | Graphics | Print | Media  Specialists  http://alt-web.com/http://twitter.com/altweb http://alt-web.blogspot.com/
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4374962#4374962
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4374962#4374962. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Dreamweaver by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

Maybe you are looking for