Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# substring until character single

static void Main(string[] args)
{
    string s = "223232-1.jpg";
    Console.WriteLine(s.Split('-')[0]);
    s = "443-2.jpg";
    Console.WriteLine(s.Split('-')[0]);
    s = "34443553-5.jpg";
    Console.WriteLine(s.Split('-')[0]);

Console.ReadKey();
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: encrypt with public key and decrypt with private key c# 
Csharp :: unity button not working 
Csharp :: c# parse number from string 
Csharp :: destroy gameobject with tag unity 
Csharp :: regex for accepting a file name c# 
Csharp :: C# compare date values 
Csharp :: vb.net get date minus one day 
Csharp :: singleton design pattern c# volatile 
Csharp :: how to uncheck a radio button in c# 
Csharp :: razor concatonate inline 
Csharp :: how to keep rigidbody2D upright unity 
Csharp :: c# entity framework get all records from table 
Csharp :: unity camera fade to black 
Csharp :: and operator in c# 
Csharp :: frustum 
Csharp :: fluent api 
Csharp :: update table in C# 
Csharp :: print c# 
Csharp :: httpclient 
Csharp :: drop down list razor example 
Csharp :: how to add event function from code in wpf 
Csharp :: asp net saber ip address of client machine IIS 
Csharp :: c# minimise form 
Csharp :: linq c# object except two lists 
Csharp :: persian datapicker 
Csharp :: interop C# save as and replace 
Csharp :: How to decode Microsoft Local token in service 
Csharp :: oracle c# parameters wont work 
Csharp :: string is int f# 
Csharp :: mvc model validation for decimal type 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =