How to remove zero using Regx
-
Hi all, Any one suggest me how to remove Zero in the first place. For eg : 0208 in this I want to remove the zero only in the first occurance, therfore the output should be like 208. how to achive this using reguler expression? Because i need a solution using reguler expression Also the length should be only 4. Thanks in advance
Know is Drop, Unknown is Ocean
-
Hi all, Any one suggest me how to remove Zero in the first place. For eg : 0208 in this I want to remove the zero only in the first occurance, therfore the output should be like 208. how to achive this using reguler expression? Because i need a solution using reguler expression Also the length should be only 4. Thanks in advance
Know is Drop, Unknown is Ocean
Hi all, Sorry for this post. I found the solution. Please tell me is this a correct solution Regex regex = new Regex(@"\d{4}", RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline); string result=""; if (regex.IsMatch("00585")) { regex = new Regex(@"^0*"); result= regex.Replace("000508050", @""); } OutPut: 508050
Know is Drop, Unknown is Ocean
-
Hi all, Sorry for this post. I found the solution. Please tell me is this a correct solution Regex regex = new Regex(@"\d{4}", RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline); string result=""; if (regex.IsMatch("00585")) { regex = new Regex(@"^0*"); result= regex.Replace("000508050", @""); } OutPut: 508050
Know is Drop, Unknown is Ocean