regex to concatenate two strings in C# -


is possible concatenate 2 sub strings input string using regex example : input string "abttpqr 00100300250000" , want take first 2 characters "ab" , first 9 digits "001003002" , concatenate these 2 string 1 "ab001003002"

much shorter variation using references:

regex.replace("abttpqr 00100300250000", @"^(\w{2})\w*\s(\d{9})\d+$", @"$1$2") // = "ab001003002" 

Comments

Popular posts from this blog

php - Wordpress: Link a post to posts of another category manually -

delphi xe7 upload/download dropbox file using the rest client and show progress -

java - Get more than One value and display it -