BHoM / BHoM/LadybugTools_Toolkit
String case changes
- Dominant language
- Python
- Stars
- 3
- Forks
- 2
- Avg merge
- 8d 20h
- Merged PRs (30d)
- 2
Description
#### Description:
Should string case changes even be here? If so, then they could be done better using switch-cases, for example:
```c#
[Description("Convert the case of the given text.")]
[Input("str", "Text to convert the case of.")]
[Input("stringCase", "The case to convert the text to.")]
[Input("ignoreList", "A list of strings to ignore when converting the case.")]
[Output("str", "Text in the target case.")]
public static string ToCase(this string str, StringCase stringCase = StringCase.Undefined, List ignoreList = null)
{
switch (stringCase)
{
case StringCase.Pascal:
return ToPascalCase(str, ignoreList);
case StringCase.Snake:
return ToSnakeCase(str, ignoreList);
case StringCase.Camel:
return ToCamelCase(str, ignoreList);
default:
BH.Engine.Base.Compute.RecordWarning($"No change to the input ({str}) was made");
return str;
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.