iOS Question search in string

Discussion in 'iOS Questions' started by Ramezanpour, Apr 8, 2015.

  1. Ramezanpour

    Ramezanpour Active Member Licensed User

    Hi

    I want to search in string.

    this is my string : "This is test,hi how are you im fine thank you"

    i want to search a text start with hi and end with you

    Now I want to return : "hi how are you"
     
  2. narek adonts

    narek adonts Well-Known Member Licensed User

    Use "your string".substring
     
    Ramezanpour likes this.
  3. Ramezanpour

    Ramezanpour Active Member Licensed User

    Hi there
    And thanks for your help

    Only problem here is that:
    I do not know content of the text and characters.

    I want to create string searcher...
     
  4. narek adonts

    narek adonts Well-Known Member Licensed User

    "your string".substring2("your string".contains("search string"), "search string".size)
     
    Ramezanpour likes this.
  5. Ramezanpour

    Ramezanpour Active Member Licensed User

    thanks
    but again , No :(

    I want to to download a url (I use httpjob and i use site source code)

    source code is string.

    and in this source code , there is a photo URL (example: http://b4x.com/test.jpg)

    and i want to find this and download this and show in image view and save in album
     
  6. narek adonts

    narek adonts Well-Known Member Licensed User

    you should create your expression to filter image url from string.
    search on internet. maybe there is already a regex expression for this.
     
    Ramezanpour likes this.
  7. Ramezanpour

    Ramezanpour Active Member Licensed User

    I want to create instagram downloader

    can you help me to use this method or other method?
     
  8. narek adonts

    narek adonts Well-Known Member Licensed User

    I dont know what type of img scr is using instagram im their html code
     
    Ramezanpour likes this.
  9. Ramezanpour

    Ramezanpour Active Member Licensed User

    solved

    I use regex
     
    narek adonts likes this.
  10. narek adonts

    narek adonts Well-Known Member Licensed User

    Share your code snippet so others will know how to use regex and matcher
     
    Ramezanpour likes this.
  11. Ramezanpour

    Ramezanpour Active Member Licensed User

    Of course!

    Code:
    Dim im As String


    im = 
    "https://igcdn-photos-e-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-15/11117017_1625492971005836_1706300614_n.jpg"

    Dim mm As Matcher
    mm = 
    Regex.Matcher("https://.*(jpg|mp4)",im)

    Do While mm.Find
    Log ( mm.Match)



    Loop

      
    Loop
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice