Search notes:

.NET: splitting strings with String.Split()

C-Sharp example to split strings

System.String has the method Split() that allows to split a string into pieces (or words).
using System;

class Prg {

   public static void Main() {

      String txt = "Hello, world! The words are: foo, bar, baz.";

      String[] words = txt.Split(
             new char[] { ' ', '.', ',', ':', '!', '?' },
             StringSplitOptions.RemoveEmptyEntries
          );

      foreach (String word in words) {
         Console.WriteLine(word);
      }

   }
}
Github repository .NET-API, path: /System/String/Split.cs

See also

The PowerShell operator -split.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1758200864, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/String/Split(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78