Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Monday 2 June 2014

Regex for getting only number output from string

           
           SPUser oUser = oWeb.CurrentUser;
            string currUserName = oUser.Name;
            if (currUserName.Contains(';'))
            {
                try { currUserName = currUserName.Split(';')[1]; }
                catch (Exception ex) { }
            }
            string loginidno = Regex.Replace(oUser.LoginName, @"\D", "");

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.