Support Forums
Get Country Code In 1 Line Of Code. - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: Get Country Code In 1 Line Of Code. (/showthread.php?tid=10194)

Pages: 1 2


Get Country Code In 1 Line Of Code. - wchar_t - 07-25-2010

Code:
Public Shared Function CountryCode() As String
        [b]Return RegionInfo.CurrentRegion.ThreeLetterISORegionName[/b]
    End Function

here I have just put it as a function.

maybe you can find a good use for this.

As I have still seen people using 10s of line of code for something that can be done in 1 line.

Non


RE: Get Country Code In 1 Line Of Code. - mmki - 07-27-2010

Thanks bro. Ive never seen this used before Tongue


RE: Get Country Code In 1 Line Of Code. - InSaNe iS BoSS - 07-28-2010

Wow, thanks for the share BlaiR.. I will use this Smile


RE: Get Country Code In 1 Line Of Code. - Clay - 07-28-2010

Wow, I didn't know this was so simple. Thanks for the share, might have to use this in my future projects. Tongue


RE: Get Country Code In 1 Line Of Code. - Thoth - 07-29-2010

Nice and simple thanks :3


RE: Get Country Code In 1 Line Of Code. - wchar_t - 08-05-2010

You May Also Use.

Code:
RegionInfo.CurrentRegion.EnglishName

To Return "United Kingdom", "Canada" Etc.


RE: Get Country Code In 1 Line Of Code. - XACTLYSIN - 08-05-2010

Thanks for this share Blair


RE: Get Country Code In 1 Line Of Code. - xHtmlPhP - 08-10-2010

I love this, I use it all the time Big Grin And, you put BBCode inside the code :/


RE: Get Country Code In 1 Line Of Code. - .Nielz - 08-13-2010

This is easy as hell , thank you for sharing Smile


RE: Get Country Code In 1 Line Of Code. - wchar_t - 08-13-2010

(08-13-2010, 03:52 AM).Nielz Wrote: This is easy as hell , thank you for sharing Smile

No Problem.

Smile