Learn C# for beginners: 7 - Using the String Data Type

Поділитися
Вставка
  • Опубліковано 22 жов 2024
  • If you enjoyed this video please comment below and give me a thumbs up! It goes a long way.
    If you want to keep watching these videos make sure to subscribe!
    You can contact me at:
    Twitter: / jdprogramming
    For business Inquires please email at: JDProgramming@Outlook.com

КОМЕНТАРІ • 8

  • @arkplato2186
    @arkplato2186 2 роки тому

    Hoping to learn much more on the way. This is marvellous material.

  • @garypowell3566
    @garypowell3566 6 років тому

    Excellent work.

  • @venkatramana331
    @venkatramana331 5 років тому

    Very good explanation

  • @goldenpants6323
    @goldenpants6323 6 років тому

    Indeed Excellent!

  • @pejmanparchami5644
    @pejmanparchami5644 4 роки тому

    Learn C# for beginners: 7 - Using the String Data Type
    String name1 = "Bob";
    String name2 = "Bob";
    (different ways of comparing)
    bool namesEqual = name1 == name2;
    bool namesEqual = string.Equals(name1, name2);
    int namesEqual = string.Compare(name1, name2); (does not return true or false but returns a value -1 0 1 )
    int namesEqual = name1.CompareTo(name2); (different way of comparing)
    To see how many characters a name has
    Console.WriteLine("{0} has {1} charachters", name1,name1.Length);
    Get a portion of a string
    string firstCharachters = name1.Substring(0, 1); (0 is the start, 1 is how many characters from start do you want. )
    Does the string Startwith?
    bool startsWith = name1.StartsWith ("Jess");

  • @patrickjoel8779
    @patrickjoel8779 4 роки тому

    Functions for strings
    -string.equal(argument1,argument2)
    -string.compare(argument1,arg2)
    -arg1.compareto(arg2)
    -argument.lenght
    -argument.startwith("string/char")
    argument.substring(index,number of char)

  • @marvilous292
    @marvilous292 Рік тому

    ever tried to align the slashes for the comments, lol

  • @patrickjoel8779
    @patrickjoel8779 4 роки тому

    C# has too many in build function.
    Subprograms makes c# very good and easy than c programming in which you build a function to compare