Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 linqParametry
- {
- public partial class Glowne : Form
- {
- public Glowne()
- {
- InitializeComponent();
- }
- private void buttonStart_Click(object sender, EventArgs e)
- {
- try
- {
- string input = richTextBoxStart.Text;
- string deleteText = input.Substring(input.IndexOf("parameters") + 11);
- //string[] split = richTextBoxFinish.Text.Split(new string[] { "{" }, StringSplitOptions.None);
- var newText = deleteText.Replace('{', ' ').Replace('}', ' ').Replace(" ", "").Replace("True", "1");
- var splittedText = newText.Split(',');
- var aStringBuilder = new StringBuilder(input);
- int i = 0;
- string j = ":p" + i;
- foreach (var item in splittedText)
- {
- aStringBuilder.Replace(":p" + i , " " + splittedText[i]);
- i++;
- }
- string pomoc = aStringBuilder.ToString();
- if (pomoc.Contains("' with parameters"))
- pomoc = pomoc.Substring(0, pomoc.LastIndexOf("' with parameters"));
- richTextBoxFinish.Text = pomoc;
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement