iOS Question String functions like right, left, etc..

Discussion in 'iOS Questions' started by inakigarm, Jan 22, 2015.

  1. inakigarm

    inakigarm Well-Known Member Licensed User

    Hi:

    I'm looking for this kind of string functions in B4i but I haven't found them

    If there's no core or additional string functions library, is there another option ??(regex alternative or inline objective C code for ex ??

    Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The StringsFunctions library which was implemented in B4A is based on the core features of B4A. All these features are available in B4i.

    You can easily use Substring or Substring2 to implement these functions.
     
  3. inakigarm

    inakigarm Well-Known Member Licensed User

    Ok Done !
     
  4. John Sparrow

    John Sparrow Member Licensed User

    Hi. I am not clear how I can use SubString or SubString2 in B4i. There does not appear to be a StringFunctions library.Can anyone advise?
     
  5. inakigarm

    inakigarm Well-Known Member Licensed User

    It depends about the string function you want; if you want to implement Left$ or Right$ is easy to code in a class module (with substring)
     
  6. John Sparrow

    John Sparrow Member Licensed User

    Thanks. My b4a implementation saves out a 24 character progress code which, on reloading, is then read and parsed into the respective variables using ProgressCode.SubString2(0,1) etc.

    Substring does not work in b4i. I heard that the b4a stringfunctions library could somehow be run as a module in b4i but I don't know how.

    Any ideas?
     
  7. klaus

    klaus Expert Licensed User

    What is not working with SubString2 in B4i ?
    txt1 = ProgressCode.SubString2(0, 1)
    Returns the first character in ProgressCode.
    It's the same as in B4A.
    StringFunctions, in B4A, was developped by margret as a code module at the beginning and afterwards compiled to a library.
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    As Klaus wrote, SubString and Substring2 do work properly in B4i. Please post the relevant code and the the string that you are working with.
     
  9. John Sparrow

    John Sparrow Member Licensed User

    My fault. My variable had been DIMed as an Int not String. Apologies.
     
  10. davepamn

    davepamn Active Member Licensed User

    Will Stringfunctions become a shared module in future releases. I really like the functionality of SF
     
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