Spacc BBS Spacc BBS
    • Categorie
    • Recenti
    • Tag
    • Popolare
    • Mondo
    • Utenti
    • Gruppi
    • Registrati
    • Accedi
    La nuova BBS è in fase Alpha. I post precedenti al 22 luglio 2024 potrebbero non essere trasferibili, ma rimarranno disponibili per la lettura su /old/.

    #lua question: If I want to check whether all the characters in a string are upper case, (so that it returns `true`), how do I go about doing this?

    Pianificato Fissato Bloccato Spostato Uncategorized
    luaprogrammingquestionlearning
    2 Post 2 Autori 0 Visualizzazioni
    Caricamento altri post
    • Da Vecchi a Nuovi
    • Da Nuovi a Vecchi
    • Più Voti
    Rispondi
    • Topic risposta
    Effettua l'accesso per rispondere
    Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
    • jectoons@comicscamp.clubJ Questo utente è esterno a questo forum
      jectoons@comicscamp.club
      ultima modifica di

      #lua question: If I want to check whether all the characters in a string are upper case, (so that it returns `true`), how do I go about doing this?

      My initial thought is

      `function uc(inp)
      if string.match(inp, "%u") and inp ~= string.match(inp, "%l") then
      return true
      else
      return false
      end
      end
      `

      And this returns true for "H" and false for "h", but true for "Hh"...

      any ideas?
      #programming #question #learning

      xarvos@outerheaven.clubX 1 Risposta Ultima Risposta Rispondi Cita 1 0
      • xarvos@outerheaven.clubX Questo utente è esterno a questo forum
        xarvos@outerheaven.club @jectoons@comicscamp.club
        ultima modifica di

        @jectoons@comicscamp.club you can convert the string to upper case and see if it's changed

        1 Risposta Ultima Risposta Rispondi Cita 1 0
        • gustavinobevilacqua@mastodon.cisti.orgG gustavinobevilacqua@mastodon.cisti.org shared this topic
        • Primo post
          Ultimo post