Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Viktor's example
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Console.WriteLine("Начало работы. Пример!"); string c = "123 456 789 слово1 блабла трындец абрикос кукуруза Витя привет много слов сколько хочешь", nline; string[] words = c.Split(' '); for(int i=words.Length - 1; i>1; i--) { nline = c.Substring(0, c.LastIndexOf(' ' + words[i])); Console.WriteLine(nline); } Console.WriteLine("Конец работы!"); } } }
run
|
edit
|
history
|
help
0
Programmes
ref variables/parameters
2.2 gz
Dynamic
Remove Duplicates - Asif Ali
Types
V
Nested Namespace
Linq FirstOrDefault() null check in c#
ds