Check a String for a particular text

Hi, I have a String variable.
How do I check if this String has Something 'like' Apple 1?
Eg:
String name=null;
Now the value in name can be apple 1 or apple 99 or apple 33. SO I need to put an IF statement where i want to say continue IF name is like "Appl 1

String.find(Pattern)Dry. I think that's matcher.find(Pattern)

Similar Messages

  • To check the string for a particular character

    i want to check the string contains ',' (comma) or not. can anyone help me?

    i want to check the string contains ',' (comma) or
    not. can anyone help me?you can use 'indexOf' method at string object
    String s1 = "test,tet1";
    boolean bfind = s1.indexOf(',') > -1 or
    boolean bfind = s1.indexOf(",") > -1

  • Match the string for a particular format

    i want to chek the string for a particular format..
    lets say for ex ,
    i have to check the string for 6A1N format where A - Alphabets and N - Numbers.
    that means my string exactly contains 6 alphabets from a to z and one number from 0 to 9
    like this i want to check for two more fromats..they are..
    2A7N1A or
    9N1A

    koneru9999 wrote:
    will the pattern is helpful in my case?
    and i don't have any idea doesn't mean finsh reading all the API right?You need to study http://www.regular-expressions.info/ and then http://java.sun.com/docs/books/tutorial/essential/regex/ .

  • Check the stock for a particular material belonging to a material group.

    Hi,
    Is it possible to check the stock for a particular material belonging to a material group.
    Your help will be appreciated.
    Regards,
    kavita.

    Hi Kavita,
    go to transaction MB52 , in the selection screen enter the material and the material group  that you want the results for, and execute. You will get desired results.
    Regards
    Mangesh
    Reward points if it helps
    Message was edited by:
            Mangesh More

  • How can one search SmartForms for a particular text or string?

    Hello fellow SAP developers,
    Our client has a need to search for a particular string in all of our Smart Forms and SAPScripts.  For SAPScripts I was able to write a simple Z-Program using function module u201CREAD_FORMu201D to accomplish this.  However, for SmartForms I do not see such an option.
    Could you kindly give me any advice on a similar function module I could use to search through Smart Forms for a particular string?
    Thank you so very much,
    Chris

    Hello Christopher and SAP developers,
    I would like to recover this post, since I'm exactly in the same situation: our client needs a change in its nomenclature and it would be helpful to learn an efficient way to change the string from the SmartForms.
    At the end, did you found a "smart" way to do this?
    Thank you in advance,
    Steve

  • How to create a group/list of check box variables for display in text field, in appended format

    I need to identify a series of single-response checkbox variables and display the ones selected (as a group) in a text field in an appended (comma, space) format. Last week, you provided a great little script for a similar need using List Box (multiple response) variables. This time I need to know how to formally identify the checkbox variables and, I presume, use a similar script to display the results in a comma, space format.
    You've been of great help.
    Thanks

    Here's the script adapted to this situation. It assumes there are ten check boxes named cb1, cb1, cb2, ...cb10.
    // Custom Calculate script for text field
    (function () {
        // Initialize the string
        var v, s = "";
        // Loop through the check boxes to build up a string
        for (var i = 1; i < 11; i++) {
            // Get the value of the current check box
            v = getField("cb" + i).value;
            if (v !== "Off") {
                if (s) s += ", ";  // Add a comma and a space if needed
                s += v;  // Add the selected value
        // Set this field value to the string
        event.value = s;
    You'll have to change the field name and starting/ending numbers to match your form.

  • How to display Error for a particular text box programaticaly

    Hello All,
    I have 5 text boxes in a form and I have a requirement where if user click on any of the text boxes then i need to pass the id to class A and show the error description related to that text box in faces message.
    I have created class A in which i need to pass the id and get the error description but the problem is that the error description is in array list so i have created list of type class B which contains description.
    Right now in class A I have :-
    id ||||||||| description <>
    it1-------1.Invalid number
    -------2.Number not in use
    -------3.Number is out of range
    it2------1.error1
    2.error2
    3.error3
    and so on.....
    *public class ClassA {*
    public String Id;
    public List<ClassB> desc = new ArrayList();
    *public ClassA() {*
    super();
    *public void setId(String Id) {*
    this.Id = Id;
    *public String getId() {*
    return Id;
    *public void setDesc(List<ClassB> desc) {*
    this.desc = desc;
    *public List<ClassB> getDesc() {*
    return desc;
    *public class ClassB {*
    public String Description;
    *public ClassB() {*
    super();
    *public void setDescription(String Description) {*
    this.Description = Description;
    *public String getDescription() {*
    return Description;
    How do I pass the id and get the description for eg:- If id is it1 then How would I show all the 3 errors in faces message on value change.
    Please Suggest.
    Thanks in advance.

    your case is not clear.
    but this link may help you
    http://mjabr.wordpress.com/2011/08/31/how-to-show-multi-lines-afmessage/

  • Question on checking a string for letters. help!

    im doing a method to check if a string given by the user contains something other then a alphabet. what i did was use the Character isLetter method and simply did a charAt(count) of the string given, problem is when i was testing my method i realize that if i spaced out the string such as "abc de" it would print out my error message for that method but it shouldnt print the error msg since it contains only letters. any suggestions on how to use the isLetter() and have it accept whitespace? the method works if i just did abcde but not abc de. thanks in advance

    Try using
    if (Character.isWhitespace(c) || Character.isLetter(c)){
    // it is good
    else {
    // no good
    }where c is your character. So this way you allow both white space and letter.

  • How to seach for a particular text in comma separated values

    Hi,
    I have one table for eg. TB_Fruits.
    In that i have one column FruitsName(Varchar)
    In that column i am storing string in comma separated values.
    Select FruitsName from tb_fruits;
    Result: orange,banana,apple
    Now the issue is suppose if i try to insert any of these fruits name again then it should not allow me to insert.
    Suppose now if i try to insert ('grapes,banana')
    or
    ('apple,grapes')
    the orange,banana,apple can be in any position.
    How to check if any of these names already exist or not in the column fruitsname?
    I cannot use like or INstr function here. because the position is not fixed not even string.
    Appreciate any help.

    After doing search.
    Got to know <= 3 length in word is in stoplist.
    That's why the value ALL it was not searching in index.
    After modifying the index this problem is solved.
    CREATE INDEX
    Fruitsname_idx ON tb_fruits (FruitsName)
    indextype is ctxsys.context
    PARAMETERS('SYNC ( ON COMMIT)
    stoplist ctxsys.empty_stoplist');
    But now the issue is suppose i have value with space..
    i inserted one more row with value 'FRUITS YELLOW'
    So in the index it is storing two rows....one is for FRUITS and second is for YELLOW.
    select * from tb_fruits t where contains(t.FruitsName,'FRUITS')>0
    I will get record..but actually there should be no record.
    And it should allow me to insert. So i can insert the value FRUITS in more row.
    Any help on how to store the value with space in one row in index??

  • Search for a particular text used in formule - whole repository search

    Is there a way to search for a text used in formulae in all reports (CMS Database). We have hundreds of reports and some are using legacy Crystal formulae syntax. We want to know which reports are using such formulae.
    Please share if you have any utilities or scripts to search all reports. There is a Find/Replace feature in report formula editor.But I want to search all the reports in CMS.
    Thank you!

    Hello,
    Sorry nothing built into BOE. Only way would be to write an application to go through each report object and search, update then write back to the repository.
    You'll need a developer to write this for you or possibly contact our Professional Services to write this for you.
    Thank you
    Don

  • How to make search string for the searched text containing single quote?

    Hi all,
    When trying to search some Contacts from Eloqua, I have to make a search string which would list out some specified EmailAddress.
    Unfortunately, I meet several emails who have single quote in their spelling.
    I got 'invalid format' error when both using them directly and making single quote twice.
    Any suggestions?
    Thanks,
    Biao

    When testing, the following examples:
    GET /Api/rest/1.0/data/contacts?search=emailAddress=bm'[email protected]
    GET /Api/rest/1.0/data/contacts?search='emailAddress=bm'[email protected]'
    GET /Api/rest/1.0/data/contacts?search=emailAddress="bm'[email protected]"
    GET /Api/rest/1.0/data/contacts?search="emailAddress=bm'[email protected]"
    All return:
      "elements":
        "type":"Contact",
        "id":"1421620",
        "createdAt":"1419611518",
        "depth":"minimal",
        "name":"bm'[email protected]",
        "updatedAt":"1419611519",
        "emailAddress":"bm'[email protected]"
      "page":1,
      "pageSize":1000,
      "total":1
    Likewise, the following returns nothing:
    GET /Api/rest/1.0/data/contacts?search=emailAddress='bm'[email protected]'
    Hopefully this helps,
    Bojan

  • How to retrieve long text for a particular record

    Hi,
    I've been looking through some of the numerous posts relating to reading long texts but I can't seem to find out how to retrieve the necessary parameters for READ_TEXT for a particular record without using the GUI.
    Is there a way in ABAP that one could retrieve the parameters that are required to execute READ_TEXT just from one of the fields in the base table.  eg.  I would like to bring back a list of all materials with their associated long texts.  I can run a query on MARA for example and retrieve the necessary material information but I would like to know how I could get the necessary information, for each row in my results, to pass to READ_TEXT. 
    What information would I need to perform the above, if at all possible?
    Thanks in advance,
    Charles

    You can check out SE75.  Here is where the objects and ids are listed/maintained.  There is one trick to find the object/id.  That is,  create the text in the specific transaction.  If you are talking about header text for a sales orders, go to VA02 and enter some text and save.  Now go to SE16, enter STXH as the table name.  On the selection screen for STXH,  enter your user name for "created by" and enter the date.  Execute.  The record that you see is probably the text that you just created.  You can see the object, the id, and even how the name is built.  In this case,  it would be sales order number.
    Sometimes where you enter the text, there is a little "scroll" icon under the text editor, clicking that will tell you the object and id.  In some cases, this functionality is not there.
    Regards,
    Rich Heilman

  • Need way to find particular text in string

    Hi All,
    I want to find out a way through which I can find a particular text is contained in string or not.
    eg. "He is great explorer" contains "great" . I want to know whether "great" is present in string or not irrespective of its position within string.
    please help........
    I also want to know that in excel conclusion is always treated as text/number/date/currency according to the type of conclusion attribute. cant we write a expression which on evaluation gives some text that finally get assigned to conclusion attribute, like in word expressions written in red are evaluated.
    Edited by: user13261179 on Sep 15, 2010 7:22 AM

    Thanks for ur reply
    Can u provide me some reference on how to configure OPA for using custom function in java. I have OPA 9.4 installed on my system, Is there anything extra needed to be installed for running custom functions.
    In my second question I m asking that like in word if we write the the concatenation of string1 & string2 then after compilation its equivalent expression in RED fonts appears to its left as [string1 & string2], similarly cant we provide such expression in excel that after evaluation get assigned to conclusion attribute.
    I have tried writing the concatenation of string1 & string2 in conclusion but it assigned as text in conclusion and not evaluated before assigning.
    If there is any other way doing that please tell me.

  • How 2 add text (BSEG-SGTXT) for a particular G/L of a Document (FB02) ?

    Hi,
    The standard program RFBIBL00 does FAE(FI) posting in our custom program.
    For doing so, we are passing a file with all the revenue G/L account details based on the structure BSEG.
    The standard program creates a document for the FI posting.
    When we view the document in transaction FB03, posting has been made for all the revenue G/L accounts and
    also the corresponding VAT G/L accounts and the exact Tax amount has been determined by the standard program and posting has been made for the same.
    But the Text field (BSEG-SGTXT) is empty for the VAT G/L accounts, since those account details has been determined in run-time by the standard program.
    NOTE: Text fields have the constant value only for the revenue G/L accounts, since we pass to the file to the standard program only for the revenue G/L accounts.
    Our requirement is to add the value in the text field for a particular VAT G/L account.
    Kindly suggest few methods to add the constant value in the text field for a particular G/L account of the document through our custom program.
    Thanks in Advance.
    Yogesh.

    Thanks for your quick answer,
    I have checked the table BSAS as well, it also has no entries corresponding the above G/Laccount.
    I can find the entries in BSEG for that G/L, but since it does not have the G/L account as primary key
    my program will take very long processing time as the user will give range of G/L accounts.
    When I Check the Report FS10N with the same G/L account, and double click to see the lineitems
    it also gives me the message 'no line items found' eventhough it shows some amount in the first screen.
    Salman Zahir

  • Multi-language support for user-specified text strings used in the forms

    multi-language support for user-specified text strings used in the forms
    Instead of creating multiple forms, 1 in each different language, for the same service, is there any workaround?

    Hoan - is your question what are the considerations when creating multiligual catalogs? If so, I can tell you that at other clients I have seen them use a single catalog for one or two languages. For the two langugages, such as Spanish/English, you can create a single catalog with both of them. Once you get to more than two languages, the catalog would get unweildy and is therefore not suggested.

Maybe you are looking for

  • DMS Storage in SAP Database with Kpro.

    Hello SAP Gurus, we are using the ECC 6.0 client and still have not configured any content servers for storing the originals, but i could make use of Kpro Tick in Document type and attach n no of file to DIR, also i have tried using KPRO tick and als

  • What is wrong with the stroke in Photoshop CS5??

    The stroke tool (in the edit menu as well as the stroke effect) is a bit screwed up in CS5!! It renders really jaggy. Is this something that Adobe will fix soon? thanks; J.

  • OWB 10gR2 - Implementation Strategy

    I am trying to find what is the best strategy to install and configure a OWB environment for the following scenario on one linux server machine: There are three Oracle databases on this machine: database 1 = OWB repository owned by a owb_owner schema

  • What is outbound function module for IDoc type INFRECMASS01

    Hi, What is outbound function module for IDoc type INFRECMASS01? This is for purchasing info record. Thanks Kamal

  • Uploading my old HP printer on a new laptop with no CD drive

    Hi there, I have an Asus laptop running windows 8.1. No CD drive. ALSO don;t have my original code as the printer is about 5 years old I cant figure out how to load my HP laserjet - Prod no Q6504A;Model B01SB-0405-04 TOTALLY un-techno. Have tried sav