乘(10 * 12 * 14) [英] multiply(10*12*14)

查看:80
本文介绍了乘(10 * 12 * 14)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串

str =" 10 * 12 * 14"

现在我想要这个值的总和

ie 10乘以12乘以14

我如何得到它?


vb.net中是否有任何函数可以做到这一点?

如果我把它作为查询到数据库我得到结果,但我想用

代码。


vips



I have a string
str="10*12*14"
now I want the total of this value
i.e. 10 multiply 12 multiply 14
how do i get it ?

is there any function in vb.net to do that ??
if i put it as query to database I get the result, but I want to do it in
the code.

vips



推荐答案

用String.Split()方法解析字符串,将每个子字符串转换为

整数与System.Convert.ToInt32()方法(或Int32.Parse())并乘以

整数。


Eliyahu


" vips" < YP ** @ hotmail.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Parse the string with String.Split() method, convert every substring to
integer with System.Convert.ToInt32() method (or Int32.Parse()) and multiply
the integers.

Eliyahu

"vips" <yp**@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
我有一个字符串
str =" 10 * 12 * 14"
现在我想要这个值的总和
即10乘以12乘以14
我怎么得到它? />
vb.net中有没有这样做的功能?
如果我把它作为查询到数据库我得到了结果,但我想在代码中做到这一点。

vips

I have a string
str="10*12*14"
now I want the total of this value
i.e. 10 multiply 12 multiply 14
how do i get it ?

is there any function in vb.net to do that ??
if i put it as query to database I get the result, but I want to do it in
the code.

vips



谢谢Eliyahu,

我想知道我可以在sql查询中执行此操作吗?

之前我写过它可以使用查询来完成,但这是我的

错误。

我的意思是在sql server中有任何功能吗?

" Eliyahu Goldin" <再************* @ monarchmed.com>写在消息

新闻:OI ************** @ TK2MSFTNGP15.phx.gbl ...
thanks Eliyahu ,
I was wondering can i do this in sql query ?
I wrote it previously that it can be done using query, but It was my
mistake.
I mean is there any function in sql server ??
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
用String解析字符串.Split()方法,使用System.Convert.ToInt32()方法(或Int32.Parse())将每个子字符串转换为
整数,并将
乘以整数。

Eliyahu

" vips" < YP ** @ hotmail.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Parse the string with String.Split() method, convert every substring to
integer with System.Convert.ToInt32() method (or Int32.Parse()) and multiply the integers.

Eliyahu

"vips" <yp**@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
我有一个字符串
str =" 10 * 12 * 14"
现在我想要这个值的总和
即10乘以12乘以14
如何得到它?

vb.net中有没有这样做的功能?
如果我把它作为查询到数据库我得到结果,但我想在代码中做




I have a string
str="10*12*14"
now I want the total of this value
i.e. 10 multiply 12 multiply 14
how do i get it ?

is there any function in vb.net to do that ??
if i put it as query to database I get the result, but I want to do it in the code.

vips




是的,确定

选择10 * 12 * 14

Eliyahu


" vips" < YP ** @ hotmail.com>在留言中写道

新闻:eT **************** @ TK2MSFTNGP12.phx.gbl ...
yes, sure

select 10*12*14

Eliyahu

"vips" <yp**@hotmail.com> wrote in message
news:eT****************@TK2MSFTNGP12.phx.gbl...
谢谢Eliyahu,
我想知道我可以在sql查询中执行此操作吗?
我之前写过它可以使用查询来完成,但这是我的错误。
我的意思是有没有在sql server中的功能??

" Eliyahu Goldin" <再************* @ monarchmed.com>在消息中写道
新闻:OI ************** @ TK2MSFTNGP15.phx.gbl ...
thanks Eliyahu ,
I was wondering can i do this in sql query ?
I wrote it previously that it can be done using query, but It was my
mistake.
I mean is there any function in sql server ??
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
用String.Split()解析字符串方法,使用System.Convert.ToInt32()方法(或Int32.Parse())和
Parse the string with String.Split() method, convert every substring to
integer with System.Convert.ToInt32() method (or Int32.Parse()) and


将每个子字符串转换为整数


multiply

整数。

Eliyahu

" vips" < YP ** @ hotmail.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
the integers.

Eliyahu

"vips" <yp**@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
我有一个字符串
str =" 10 * 12 * 14"
现在我想要这个值的总和
即10乘以12乘以14
如何得到它?
如果我把它作为查询到数据库我得到了结果,但我想在代码中做到这一点。

vips

I have a string
str="10*12*14"
now I want the total of this value
i.e. 10 multiply 12 multiply 14
how do i get it ?

is there any function in vb.net to do that ??
if i put it as query to database I get the result, but I want to do it in the code.

vips





这篇关于乘(10 * 12 * 14)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆