We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

CalcQuickBase - Getting Rid of Everything Except Numbers - use - Text Functions

Hi
Getting Rid of Everything Except Numbers


Linda has a column that contains alpha and numeric characters. She needs to retain the numeric characters and delete the alpha ones. For example, a cell may contain y,y.d?d10003pyu111 and she wants to end up with 10003111.

in excel is
=EXTRACTNUMBERS("yydd10003pyu111", TRUE)


is it possible to use - Text Functions
https://help.syncfusion.com/windowsforms/calculate/supported-formulas


CalcQuickBase cq


Regards,
Gregory



1 Reply

AA Arulraj A Syncfusion Team March 4, 2019 12:18 PM UTC

Hi Gregory, 

Thanks for using Syncfusion product. 

To get the numeric value from the string, you could implement the custom function and include that function CalcEngine using AddFunction method. Please refer the following code example and the sample. 

C# 
private static CalcData calcData = new CalcData(); 
private static CalcEngine engine = new CalcEngine(calcData); 
engine.AddFunction("EXTRACTNUMBERS", new CalcEngine.LibraryFunction(ComputeEXTRACTNUMBERS)); 
 
var result = engine.ParseAndComputeFormula("EXTRACTNUMBERS(\"yydd10003pyu111\")"); 
Console.WriteLine("Result: " + result); 
 
public static string ComputeEXTRACTNUMBERS(String args) 
{ 
    string number = new String(args.Where(Char.IsDigit).ToArray()); 
    return number; 
} 
 
 

Please get back us if you need any further assistance on this. 

Arulraj A 


Loader.
Live Chat Icon For mobile
Up arrow icon