Tsallaka zuwa abun ciki
Justice Tech School

More String Methods

Contains, StartsWith, IndexOf, Replace, Trim, Split, Join and PadLeft cover most needs.

Example
string s = "  one,two,three  ";
var parts = s.Trim().Split(',');
Console.WriteLine(parts.Length);
Console.WriteLine(string.Join(" | ", parts));
Console.WriteLine(s.Contains("two"));
Console.WriteLine("7".PadLeft(3, '0'));

Exercise

Split text.

s.(',')

Quiz Test

What does Join do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.