# [SOLVED] Can I convert an user input string to lowercase letters and all ':' to '-'?



## sk0glund (Mar 9, 2011)

Hi.

I need a program that changes an user input string (in this case, a MAC address of type 00E:45:FB:0D:3E) into a string in different format.
The output string should contain only lowercase letters, and the ':' in the MAC address needs to be changed to '-'.

Example:

00E:45:FB:0D:3E to 00-de-45-fb-0d-3e


The design is pretty simple, but I've problems implementing the code that does what I require it to.

Anyone has a good tip or code suggestion for this?
The user input string should be converted upon the Click (button) event, and the input/output textbox needs to be copy/paste compatible.

Thanks!


----------



## sk0glund (Mar 9, 2011)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Forgot to mention, currently doing VB in Visual Studio 2010


----------



## Ninjaboi (Dec 27, 2010)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Hello sk0glund, welcome to TSF!

Does this have to be done in VB? Could we do it in any other language by chance?

To answer your question if your able to convert user input from case to lowercase and colons into '-' dashes, it's a big yes. It's actually very simple to do, even in low-level languages.

Please inform us if we're able to use other languages other than VB, as I see no reason to restrict it to just that language based on what you've said. Is there a reason to use VB only?


----------



## sk0glund (Mar 9, 2011)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Hi, and thanks for answering!

I'm not restricted to use VB only, but chose to start out in VB since most of my programming experiences are from within that language. But I'll be happy to study/learn new languages!

I'm open for any language that is executable on XP/Vista/Win 7, both 32 and 64 bit OS', as long as the operation itself runs smoothly and has a small input/output GUI.

I used to write calculators and other simple programs in VB earlier, but this is however some years ago, so my programming skills are somewhat outdatet and rusty..

Looking forward to your reply, and thanks again!


----------



## Ninjaboi (Dec 27, 2010)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Ah OK. I can do this easily in C/C++ for you. Now, just to make sure I'm understanding what you need:

- Windows GUI program.
- A box for the user to input the MAC address.
- A button that, on being clicked, converts the MAC address entered into an address with lowercase instead of case, and convert the ':' into '-'.
- The converted address should be displayed where it can be easily copied and pasted by the user.
- This program needs to be simple, small, and easy to use.

Am I getting all this correctly?


----------



## sk0glund (Mar 9, 2011)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

That is correct Ninjaboi, exactly what I need ray:


----------



## Ninjaboi (Dec 27, 2010)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Alright, glad I got it right lol. I'll be working on it then.


----------



## sk0glund (Mar 9, 2011)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

If it could compitable with "Paste + enter", not only the Click event, it would be awesome!

Thanks again,
sk0glund


----------



## sk0glund (Mar 9, 2011)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Ah didn't see your reply until now, either way works fine Ninjaboi!


----------



## Ninjaboi (Dec 27, 2010)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Lol alright. I couldn't work on it yesterday due to family matters, but now I should be able to. Once I get started, it should only take half an hour lol. I'll get it set up now, then here in the next few hours I'll take the time to finish.


----------



## sk0glund (Mar 9, 2011)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Sure no problem, thanks alot!


----------



## Ninjaboi (Dec 27, 2010)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

http://rapidshare.com/files/451975450/MAC_Address_Converter.rar

That's the .rar compression of the application. I'll tell you the truth...C++/CLI sucks lol. I tried it years ago, and tried it again for this to see why I stopped trying to learn this variation of C++ and now I remember why I didn't learn it. It's very sloppy, hard to read, and confusing on several methods to implement. I did that application using it, and it was probably one of the hardest things for me to do...and it was a very simple application to do normally with standard C++.

All in all, very sorry it took so long. I figured I'd try using that variation of the language, and I can recommend you to NOT use it lol.

The application works great, with all the features you asked for. If you still want the code, I can give it to you. Honestly though, I'd say save yourself the effort. Managed C++ ( C++/CLI ) is depreciated, and is not used much in the programming community.

If it doesn't work for you, tell me and I'll fix it up. I tested it on two separate machines running XP and 7.

Regards, Ninjaboi.


----------



## sk0glund (Mar 9, 2011)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Works great, thanks alot Ninjaboi!

I'll let you know if any problems occurs 

Thanks again


----------



## Ninjaboi (Dec 27, 2010)

*Re: Can I convert an user input string to lowercase letters and all ':' to '-'?*

Great! Glad it works!


----------

