Topic
  • 4 replies
  • Latest Post - ‏2017-02-02T06:51:03Z by vignesjoseph
tanvimachado
tanvimachado
3 Posts

Pinned topic Finding the location of a substring in a string

‏2013-07-16T10:36:47Z | functions nco_sql netcool omnibus string substring

Hi,

I am trying to locate the position of a substring in a string field in omnibus.

eg: If the string is 'Hello my name is XYZ', I want to find the location (or index) of XYZ.

I should get the index as 17.

I have tried functions like charindex, patindex, instr, locate. All of them give errors.

Please help.

  • User_Technologies_and_Delivery
    2 Posts

    Re: Finding the location of a substring in a string

    ‏2013-07-26T16:26:52Z  

    Hi there,

    I think I may have found a more pertinent forum for your question. Try...

    https://www.ibm.com/developerworks/community/forums/html/topic?id=ab7869f7-76f4-432a-8083-43a8f63126da

    They have an early access program which may be particularly relevant to your needs.

    Thanks!

  • wowgold5
    wowgold5
    1 Post

    Re: Finding the location of a substring in a string

    ‏2013-08-31T07:58:50Z  

    Really like your site, I feel very good .this is our website also recommend to you all to share.
    ---------------------------------------------------------------------
    http://www.d3joy.com/
    http://www.sellgw2.com/

  • lili075249
    lili075249
    3 Posts

    Re: Finding the location of a substring in a string

    ‏2014-03-05T07:19:45Z  

    With individual coordinate returning, the brown and the [url=http://www.royalwowgold.com/]World of Warcraft Gold[/url] gold credit cards are rather more valuable. Bronze and gold class players would have additional worth in mixed and higher team currently.
     

  • vignesjoseph
    vignesjoseph
    1 Post

    Re: Finding the location of a substring in a string

    ‏2017-02-02T06:51:03Z  

    There's a built-in method on string objects to do this in python you know?
    s = "Happy Birthday"
    s2 = "py"

    prints.find(s2)
    Python is a "batteries included language" there's code written to do most of what you want already (whatever you want).. unless this is homework :)