Questions tagged [casing]

38 questions
26
votes
8 answers

How do I convert PascalCase to kebab-case with C#?

How do I convert a string value in PascalCase (other name is UpperCamelCase) to kebab-case with C#? e.g. "VeryLongName" to "very-long-name"
Mikhail Shilkov
  • 34,128
  • 3
  • 68
  • 107
24
votes
6 answers

What is the best-practice casing style for javascript? Why?

One aspect of javascript that it's hard to find information on is casing practices. By casing practices, I mean what casing style (ie. camel-case, pascal-case, etc) should be used for what elements (Constructors, private functions, public…
Mark Rogers
  • 96,497
  • 18
  • 85
  • 138
21
votes
1 answer

Why is ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ the native name of the U.S.?

When I use this code: var ri = new RegionInfo("us"); var nativeName = ri.NativeName; // ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ why is nativeName then the string "ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ" (in Cherokee)? If I change to new RegionInfo("US") (only difference, capital US), I get…
Jeppe Stig Nielsen
  • 60,409
  • 11
  • 110
  • 181
16
votes
1 answer

What's the best practice for URL path casing and spacing?

I want to know what is considered a good practise for casing and spacing in URL paths. Casing: Lower-case Camel case Pascal case Spacing: None Hyphen Underscore ../data/upload_data ../data/upload-data ../data/uploadData ../Data/UploadData …
Pk King X11
  • 163
  • 1
  • 1
  • 7
12
votes
3 answers

CA1704 - Microsoft seems to be blocking the word 'Multi'?

public class MultiSomething { } //CA1704:IdentifiersShouldBeSpelledCorrectly When I run Code Analysis, I get an error because the Microsoft does not recognize the word 'Multi' (go figure they use it in IMultiValueConverter). So, what I did to…
myermian
  • 31,823
  • 24
  • 123
  • 215
12
votes
3 answers

MySQL automatically cast/convert a string to a number?

Does MySQL automatically casting\converting the string to numeric value? How does that conversion works? '1234'=1234 ? '1abc' = 1 ? 'text' = 1 ? Given that units.id is of bigint type, how this query will be interpreted? SELECT table.* FROM table…
yossi
  • 3,090
  • 7
  • 45
  • 65
8
votes
4 answers

Why is DB an acronym and not abbreviation?

According to the .NET framework design guidelines, they say DB is an acronym and cased as such. But I thought it was an abbreviation of database?
squi
7
votes
3 answers

Best way to check for upper/lower case query strings

I have a problem where I need to extract a query string parameter from a url. The parameter could be either "Territory" or "territory" or other upper/lower case variations of that word. Although the following works for the first two cases I wonder…
rmcsharry
  • 5,363
  • 6
  • 65
  • 108
6
votes
1 answer

LINQ to XML: Ignoring of the case of attributes

I use LINQ to XML for working with PackageContents.xml file, created by Autodesk company. Company has defined the structure of this XML file here, but without XSD schema. I have a problem: This company breaks his the rules... Often the case of…
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
4
votes
4 answers

c# file path string comparison case insensitivity

I would like to compare two strings containing file paths in c#. However, since in ntfs the default is to use case insensitive paths, I would like the string comparison to be case insensitive in the same way. However I can't seem to find any…
Cedric Mamo
  • 1,724
  • 2
  • 18
  • 33
4
votes
2 answers

How to force UpperCase in a VS2008 snippet?

I've settled on the following style of creating properties (with a backing field): private _firstName; public string FirstName { get { return _firstName; } set { _firstName = value; } } Given that the name of the property is similar to the…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
3
votes
3 answers

Does naming conventions make better maintainable code?

I like to give my variables, methods and objects descriptive names. Obviously not going overboard, but let me give you a couple of examples. public class Account { public decimal Balance { get; set; } } Account account = new…
Pieter Germishuys
  • 4,828
  • 1
  • 26
  • 34
3
votes
1 answer

Git checkout file - casing in file name

Git newbie here :) Faced casing-related problem: file aspnetdb.mdf was removed from repository several commits ago, I decided to restore it from some of earlier commits and did it is such way: git checkout master~3 aspnetdb.mdf wanted to get…
alex.b
  • 4,547
  • 1
  • 31
  • 52
2
votes
1 answer

Why are browsers not caching these static files

my question seems duplicate of this but I am having a case when I refresh a page with F5 then images are not getting fetched from cache instead request is going to server and server responding 304 status code(not modified) but if I type a URL in…
Raghvendra Parashar
  • 3,883
  • 1
  • 23
  • 36
2
votes
3 answers

Determine if HashSet contains a different cased string

I have a large set of strings, including many duplicates. It is important that all of the duplicates have the same casing. So this set would fail the test: String[] strings = new String[] { "a", "A", "b", "C", "b" }; ....but this test would…
Dai
  • 141,631
  • 28
  • 261
  • 374
1
2 3