gpt4 book ai didi

vb.net - 使用 VB 计算字符串的数学表达式

转载 作者:行者123 更新时间:2023-12-02 09:18:39 25 4
gpt4 key购买 nike

我想使用 VB 从字符串计算算术表达式,有什么想法吗?

举个例子:文本框中的“x+2”,我想计算表达式

最佳答案

Dim equation As String = "2+6/2"
Dim result = New DataTable().Compute(equation, Nothing)

关于vb.net - 使用 VB 计算字符串的数学表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13178637/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com