How to search a word in string

hi all
tstxt = 'mnr ptds xyz king fox'.
i want to make a condition..like
if tstxt contains king.  *
execute statement.
endif.
how can i search the word in string

Hi,
You can search like this
if tstxt CS 'king'. "CS stands for Contains String a relational operator.
*Execute here
endif.
Regards,
Sesh

Similar Messages

  • How to search a word in a 2d array

    Hi, i'm seeking advice on how to search a word in 2d array. The method will only taking one argument string and will search in row by row, column by column and diagonall down and up. for example, user input String "SEEK" or then the method will have different search pattern to locate the word. Here is the 2d array look like.
    S + K E E S + +
    E + + + + + + K
    E S + + + + + E
    K + E + + + + E
    + + + E + + + S
    + + + + K + + +
    What i've done so far is;
    // this loop is for search SEEK column by column
    public boolean finder(String w){
    for(int j = 0; j < puzzle[0].length; j++) {
    for(int a = 0; a < w.length(); a++) {
    char n = w.charAt(a);
    String r = String.valueOf(n);
    if (puzzle[0][j] != w.charAt(a)) {
    return false
    } else {
    return true;

    read this

  • How to search for a pattern string in entire registry and delete all the keys and subkeys that contain the pattern (C# or VB)?

    I want to search for a pattern string in the entire registry and need to delete all the keys and sub-keys that contain the pattern. How can I implement this in VB Script or C#? Appreciate if you can give some sample examples. Now every time, I am manually
    searching for the pattern in registry and deleting one by one.
    Thanks Prasad

    There is no built in way to do this. You'll end up having to enumerate all keys and values in the entire registry and comparing each one for a pattern using Regex or similar.  This is going to be really slow but there isn't much else you can do about
    it (other than parallelize the enumeration).  Also note that you won't have permissions to all keys for read and/or write access so you'll need to skip over those using exception handling.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • How to search for subset of string

    Hi,
    I'm trying to implement Oracle text in 8i and 9i to search for a given string or a subset of string.
    For example, if the given string="Database Technology", I would like intermedia to first search for the exact string - "Database Technology",
    if not found, then search for either "Database" or "Technology".
    I'm only able to search for the exact string ("Database Technology") so far by using the contain clause. I'm not able to get Oracle Text to return me any records that also contains "Database" or "Technology" if the exact match "Database Technology" cannot be located.
    Any help is very much appreciated.
    thanks.
    elain

    You need to use the ACCUM operator. It raises the score based on the the frequencies of more than one word. Here are the contents of my TEXT1 test table:
    TEXT
    database
    server
    database server
    database blah blah database
    database blah blah server
    select score(1), text1.* from text1 where contains(text,'database ACCUM server ACCUM database server',1) > 0 order by score(1) desc;
    and here are the results:
    SCORE(1) TEXT
    68 database server
    34 database blah blah server
    2 database blah blah database
    1 server
    1 database
    You may want to put a multiplier on the "database server" phrase's score to increase the score on when the complete phrase is found. That looks like this, for example:
    select score(1), text1.text from text1 where contains(text,'database ACCUM server ACCUM database server*3',1) > 0 order by score(1) desc
    Tom Best

  • How to search a word and its page in Acrobat 6.0 using vb6.0

    Hi all,
    I would like to search a word and its corresponding page number in my PDF document. The word may be occur in many of the pages and i have to collect all the page numbers and need to create bookmark for all of them.
    Eg: The word "Chennai" can be found in the pages 5, 6, 7 and10. Then I need to create bookmarks Chennai1 - Page 5, Chennai2 - Page 6 and so on...
    I have tried this with Acrobat 7.0 professional and it was working fine. But in 6.0 Professional i am not able to collect all the pages. Below I have given the code that i have used.
    Dim objFind As Acrobat.CAcroAVDoc
    Set objFind = CreateObject("AcroExch.AVDoc")
    Do While objFind.FindText("MyText", 0, 1, False)
                    Dim objPageView As Acrobat.CAcroAVPageView
                    Set objPageView = objFind.GetAVPageView
                    strPageNo = objPageView.GetPageNum + 1
                    If strPageNo = strPrevPageNo Then
                        intIncremental = intIncremental + 1
                    Else
                        intIncremental = 0
                    End If
                    If intIncremental > 50 Then
                        Exit Do
                    End If
                    If Val(strPageNo) < Val(strPrevPageNo) Then
                        Exit Do
                    End If
                    strPrevPageNo = strPageNo
    Loop
    Thanks in advance,
    Dhanasekaran. G

    Adobe no longer supports Acrobat 7 or earlier.

  • How to search for words in a string?

    I have a list of strings that I need to search for instances
    of a certain word (or part of that word) is there a way of doing
    this in flash please?

    Quickest and easiest way to do it is to search through an
    array of manually entered words.

  • How to search and replace a string in Excel Shape (textbox) using Powershell.

    I have been asked to write a PS script to search/replace a string when found in Excel Shapes when they are textboxes. I have seen lots of simplistic PS scripts and even I can do a "foreach" loop through all the Shapes on a Sheet and display the
    Name of each Shape. But I have not found a property or method to expose the actual text in a textbox let alone change it.
    I have seen vba script that does this as:  
    Set xWs = Application.ActiveWorkbook.Worksheets(I)
    For Each shp In xWs.Shapes
    xValue = shp.TextFrame.Characters.Text
    shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
    Next
    In Powershell, shp.TextFrame.Characters.Text is ignored and returns nothing.  It would be nice to know if this is possible in PS and if so, know how to do it and/or get an example to work from.  I would have thought that
    PS and VB would use the same Excel object model but apparently they do not.
    I am using Excel 14.0 and PS 3.
    Any suggestions would be appreciated,
    Michael

    This didn't work for me.  I have the shape object and it shows the textframe property:
    PS C:\> $shape | gm
       TypeName: System.__ComObject#{00024439-0000-0000-c000-000000000046}
    Name                       MemberType Definition
    Apply                      Method     void Apply ()
    CanvasCropBottom           Method     void CanvasCropBottom (float)
    SoftEdge                   Property   SoftEdgeFormat SoftEdge () {get}
    TextEffect                 Property   TextEffectFormat TextEffect () {get}
    TextFrame                  Property   TextFrame TextFrame () {get}
    TextFrame2                 Property   TextFrame2 TextFrame2 () {get}
    ThreeD                     Property   ThreeDFormat ThreeD () {get}
    But trying to access it gives an error:
    PS C:\> $shape.textframe | gm
    gm : You must specify an object for the Get-Member cmdlet.
    At line:1 char:20
    + $shape.textframe | gm
    +                    ~~
        + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
        + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand
    PS C:\> $shape.TextFrame.Characters().text="hello"
    You cannot call a method on a null-valued expression.
    At line:1 char:1
    + $shape.TextFrame.Characters().text="hello"
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    I hope this post has helped!

  • How to search for a specific String within an ArrayList

    I am creating an inherited class, CD, that has a field of "tracks". I am wondering how you would search through the ArrayList and list the track number that correlates with a search term. For instance, if I have a track called "Radar Love" and it is track number 2, how would I create the search function to find out what track number "Radar Love" is?

    trojansc82 wrote:
    int index = 0;
    boolean found = false;
    while(index < tracks.size() && !found){
    String track = tracks.get(index);
    if(track.contains(searchString)){
    found =true;
    else{
    index++;
    return index;It's still the same code. I attempted putting in a return statement with tracks.get(index), but it didn't work.Edited by: Edward_Kimber on Nov 15, 2008 2:57 PM

  • How to search for a text string in Reports designer?

    In iDS reports (10gR2), I want to search from top down for a text string was used in one of the queries or triggers. In Forms, you can do it, in reports the related menu item is always seems to be grayed out no matter what item I pick in the Navigator. Is it doable or not? If yes, then how. I don't wanna open each program piece including the queries in the data model, report triggers or program units and look for (by visual scanning) for the text I am searching for. This is crazy. There must be a way to do it. Thanx.

    That is pretty bad for such an expensive report development program. The forms allows it, I wonder why Oracle did not include similar functionality in the reports developer. I knew the conversion to ascii, but during development it is pain in the ... just to search for a simple text string in the related program units in the report, to convert to ascii, do the search and then go back to the developer. Anyway, if that is the only way, there is nothing we can do I guess :(

  • How to search for words in binaries (jpg,bmp,tif,...) ??

    Hello,
    is it possible to index words from images with tenable effort ?
    We are developing a document-management-system and it would be nice
    when search includes images.
    I would appreciate very much any suggestions, links or solutions.
    regards,
    Tim

    >
    Do you mean words in images in the sense of an image
    comment (which is not visible when the image is
    displayed, but some image editors can detect and
    expose as an image property), or as text displayed as
    part of the image, like this:
    http://developer.java.sun.com/images/v4_java_sun_com.gi
    If the latter, forget it.Hello,
    first thanks for answers, I was looking for a possibility to search for text in images in order to save it in a database.
    So its the latter :(
    I thought it could be possible to use any scanner-drivers for this purpose:
    http://www.openarchive.com/echive_tifindexer.htm
    But I'm not sure how to achieve this.
    regards,
    Tim

  • How to search for words in documents in Lion

    Here's why I'm trying to ask.
    Lately I have downloaded a lot of files from Google Drive, and I'm trying to sort a lot of documents (262 exactly) by finding a set of numbers and letters that only one kind of document has.
    For example, I'm trying to find the documents that have "5R-ET1" to see which documents has those set of letters inside the documents to sort them in a diffrent folder.
    Is there something in the Finder that can allow me to do this, or is there like this program which compares documents that fits my use?
    By the way, most of the files are in .doc format, the rest are in .pages format.
    Hope there is a way to fix this situation!

    Open to correction here but I don't think Spotlight will do this for you, particulary if these are long documents. Spotlight does not index then entire document, just the first 2k approx unique terms within a document. If the string you're looking for isn't within that limit then it won't work.
    Options:
    1. You could import the documents to an app like DevonThink Pro or Circus Ponies Notebook that have a concordance feature.
    2. You could convert the files to Text and search them with BBEdit or the grep command.
    http://hints.macworld.com/article.php?story=20001105214242629

  • How to search char in a string

    hi, i am new to JSP.
    i have a string, for example an address "Frauenstrasse 10", i want to split it into street name "Frauenstrasse" and house number "10". but i don't know the syntax to process String. can anyone help? thanks!

    new StringTokenizer(myString," "); // Tokens just space
    or
    new StringTokenizer(myString); // Tokens white space
    token.hasMoreTokens(); - boolean
    token.nextToken(); - Returns String
    Stick in While loop.

  • How to search a word in PDF using acrobat javascript?

    Hi,
    I need to find a word in acrobat PDF using javascript. I used
    find text("abx");
    select text("abx");
    This doesn't work for me..
    Someone guide me.
    Thanks in advance,
    Poovili V

    I used
    find text("abx");
    select text("abx");
    This doesn't work for me..
    That is not Acrobat Javascript. In the Acrobat Javascript Reference look for the method getPageNthWord.

  • How to search for a matching string

    <cfcatch>
    <CFMAIL to="[email protected]" From="[email protected]"
    Subject="Error message" Type="HTML">
    #cfcatch.message#
    </CFMAIL>
    </cfcatch>
    I need to create a condition based on the string in the
    message, if #cfcatch.message# is "The element at position 12 of
    dimension 3 can not be found" I need to deliver certain message
    through email BUT if #cfcatch.message# is matching other
    sentence I need to deliver a different message.
    I used the following condition (see below) but it somehow did
    not work, even when I know for sure the error message is saying the
    right think, for example, "The element at position 12...etc"
    Is there a way to do this differently or have I done it wrong
    somewhere?
    <cfif #cfcatch.message# EQ "The element at position 12 of
    dimension 3 can not be found">
    Deliver message 1
    cfelse>
    Deliver message 2
    </cfif>

    Why not catch a specific error type?
    <cftry>
    <cfthrow type="foo.bar.custom" message="anything you want
    to say!">
    <cfcatch type="foo.bar.custom">
    Do something special here!
    </cfcatch>
    <cfcatch type="Any">
    An Unknown error has occured!
    </cfcatch>
    </cftry>
    If you're not sure of the error that is being thrown, dump
    the cfcatch and grab the first part of the stack trace and then
    recode using that error type in your cfcatch block.
    Here's an example of catching an invalid file format upload
    with cffile.
    <cftry>
    <cffile action="upload" destination="#pathInfo#"
    fileField="imagefile" nameconflict="makeunique" accept="image/jpg,
    image/jpeg, image/png, image/eps, image/tif, image/gif,
    application/pdf" >
    <cfcatch
    type="coldfusion.tagext.io.FileTag$InvalidUploadTypeException">
    Invalid File Type
    </cfcatch>
    </cftry>

  • How to search for a particular word in a string?

    How to search for a particular word in a string?
    thanks for your help....

    This works fine.
    public class Foo {
        public static void main(String[] args) {
        String s = "Now is the time for all good...";
        String s2 = "the time";
        System.out.println(s.contains(s2));
        System.out.println(s.contains("for al"));
        System.out.println(s.contains("not here"));
    }output:true
    true
    falseYou must have something else wrong in your code.
    JJ

Maybe you are looking for

  • Difference in information sent / received using externalisable classes

    I am a little unsure whether this is the right place to post, I am relatively new to Java but trying hard to learn it well. However this is quite a specific problem with a personal (for fun) project I have been undertaking and it is driving me slowly

  • From Old Hard Drive to New Hard Drive

    We recently got a new computer. Before we ditched the old one, we removed the old hard drive and added it to the new computer as a third drive. Is there any way that I can get my library from the Itunes folder on the old drive to the new Itunes on my

  • [CS2/CS3 JS]

    Could someone please tell me why this doesn't work. app.activeDocument.PasteboardPreferences.minimumSpaceAboveAndBelow = 50mm The reported error is "Object does not support the method or property PasteboardPreferences" I has taken this straight out o

  • 'Get Response' APDU command in a script for apdutool

    Dear all, I'm facing some problems with apdutool (javacard 2.2.2 distribution) in executing the 'Get Response' command. In fact its syntax differs from the one specified for other APDU commands accepted by apdutool, as Lc is replaced by the expected

  • How is the 'import-packages' information saved in the database, and how long?

    Hello, I am  developping a ECM Connector for Adobe LiveCycle ES, which is a customized component. 1 - Who should I contact to have some specific support  ? There is no detailed information yet on this on the adobe site  (http://livedocs.adobe.com/liv