Move all digits to the beginning of a given string | C # program for the above approach ; Function to move all the digit at the beginning of the string ; Replace all the non - numeric characters with " ▁ " and replace all digits with " ▁ " ; Print the string ; Driver Code ; Given String str
using System ; using System . Text . RegularExpressions ; public class GFG { static void moveAllDigitAtBeginning ( String str ) { String moveAllDigit = Regex . Replace ( str , " \\ D + " , " " ) + Regex . Replace ( str , " \\ d " , " " ) ; Console . WriteLine ( moveAllDigit ) ; } public static void Main ( String [ ] args ) { String str = " GeeksforGeeks1234" ; moveAllDigitAtBeginning ( str ) ; } }