C
C#3y ago
Silme94

❔ Space Problem

why the space doesn't count ?
using System;
using System.Runtime.InteropServices;

class Program{

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hW, String content, String title, uint type);
public static string text;
public static string argument;
static void Main(string[] args){
for (int i = 0; i < args.Length; i++)
{
argument = argument + args[i];
}
text = argument;
MessageBox(new IntPtr(0), text, "Error", 0);
}
}
using System;
using System.Runtime.InteropServices;

class Program{

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hW, String content, String title, uint type);
public static string text;
public static string argument;
static void Main(string[] args){
for (int i = 0; i < args.Length; i++)
{
argument = argument + args[i];
}
text = argument;
MessageBox(new IntPtr(0), text, "Error", 0);
}
}
3 Replies
Silme94
Silme94OP3y ago
then what i have to do ok yea? wym wdym like that ? argument = argument + string.Join(args[i]); ok alr its working thanks
undisputed world champions
an other option would be to call the program with msgbox "hello you!" then the "hello you!" stays together in one item in your args 😉 this will also work if you wanna use multiple spaces after each other, like "hello you!"
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server