Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2024/25/2
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

string comparison

See also std.string.

(1) string comparison
def main():
    s = "Alice"
    t = "aLiCe"

    print(s == t)  # False
    print(s.lower() == t.lower())  # True
import std.stdio;
import std.string; // toLower(), icmp()

void main()
{
    string s = "Alice";
    string t = "aLiCe";

    writeln(s == t); // false
    writeln(s.toLower == t.toLower); // true

    writeln(icmp(s, t) == 0); // true
    writeln(s.icmp(t) == 0); // true
}

icmp(): ignore-case string comparison. It returns a negative value, 0, or a positive value (like C's strcmp()).

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 June 27, 12:23