Skip to content

../notes_to_myself

  • Home
  • Portfolio
  • Sample Page

Extracting A Number From A String Using Regex

static string ExtractNumbers(string expr)

{

return string.Join(null,System.Text.RegularExpressions.Regex.Split(expr, “[^\d]”));

}

Call as follows:

Response.Write (ExtractNumbers(“12EFR77”));

Author Chrystal SanderPosted on December 18, 2010Categories DotNet

Post navigation

Previous Previous post: Find A Field Name In SQL Server
Next Next post: Searching the Text of Stored Procedures in SQL Server
  • Get Command Line Help
  • Online C# Sandbox

Android Architecture Arduino ASP.NET AWS Azure Caching Constraints CSharp cybersecurity Design Patterns DotNet Excel git IIS IOT Linq log4net Master Chief MinIO mstest MVC Notes nunit oracle Partitioning PHP PowerShell Query Def Raspberry Pi REST S3 SQL SQL Server Stored Procedures Swagger systables tools Visual Basic Visual Studio WebApi windows WordPress Xml xunit

  • Home
  • Portfolio
  • Sample Page
../notes_to_myself