小编Gra*_*son的帖子

寻找子字符串替代javascript

基本上我的问题是我在变量版本上使用 substring 方法来获取结果,然后使用 ng-href 在 URL 中使用:

substring(0, 3)
version 9.1.0 = 9.1 (good)
version 9.2.0 = 9.2 (good)
version 9.3.0 = 9.3 (good)
..
version 9.10.0 = 9.1 (breaks here)
version 10.1.0 = 10. (breaks here)
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,最终子字符串方法停止工作,我该如何解决这个问题?

javascript methods substring angularjs-ng-href

9
推荐指数
2
解决办法
2万
查看次数

C#计算器-无法在小数点前插入数字

我已经在C#中实现了一个计算器,除此之外一切正常,基本上,如果我尝试在小数点前输入数字,则会重置数字,然后才让我在小数点后输入数字,我认为这有点愚蠢。会很快解决,但我没有运气

这是我的代码:

    using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GrantCalculator
{
    public partial class Form1 : Form
    {
        int count = 0;

        float result = 0;
        string operation = "";
        bool operationPressed = false;

        public Form1()
        {
            InitializeComponent();
        }      

        private void btnClear_Click(object sender, EventArgs e)
        {
            //clearing result
            txtResult.Text = "0";
            result = 0;
        }

        private void btn_Click(object sender, EventArgs e)
        {
            if (count == 0)
            {
                //remove …
Run Code Online (Sandbox Code Playgroud)

.net c# calculator visual-studio

0
推荐指数
1
解决办法
85
查看次数