0 Favourites

How do I Compare array String with spaces

  • HI,

    i'm actually doing a menu in wich you can set differents names for a team, and save it in an arraylist.

    and there is an option to edit existing team.

    the process i'm using is actually working for teams with simple names as rococo, fire, build etc...

    but it doesn't works when i when to test composed names like: Buring Fire, Space angels etc...

    is there a way i can confirm my test when it find Array.CurrentValue = Input.Text ?

  • HI,

    i'm actually doing a menu in wich you can set differents names for a team, and save it in an arraylist.

    and there is an option to edit existing team.

    the process i'm using is actually working for teams with simple names as rococo, fire, build etc...

    but it doesn't works when i when to test composed names like: Buring Fire, Space angels etc...

    is there a way i can confirm my test when it find Array.CurrentValue = Input.Text ?

    Are you sure that this works even without spaces?

    Your variable NomExist will be overwritten with 1 even if you found the name in the Array, because the next element set the variable back to 1.Even if the last element is the name you are looking for, the variable will be set to 1 in the next tick, when the loop starts again. The variable will only a very short time 2.

    Delete the first sub-event and it should work. You have to set the variable back to 1 after you have done what you want to do if you found a name, outside of the loop.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • ok, i did wrong, it works only if the name is the last of the array during the test else it's overwrited.

    thanks for your help

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)