Advertisement
LegionMammal978

ToCamelCase operation

Mar 4th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. ToCamelCase[n_] := Module[{Macros`Evaluation`PackagePrivate`r$}, Macros`Evaluation`PackagePrivate`r$ = Which[!Quiet[TrueQ[GeneralUtilities`Strings`PackagePrivate`strsq[str]]], Message[ToCamelCase::strse, 1, ToCamelCase[str]]; Macros`$FailRHS, True, Macros`HoldSequence[GeneralUtilities`Mapped[GeneralUtilities`Strings`PackagePrivate`iToCamelCase][str]]]; RuleCondition[Macros`ReleaseHoldSequence[Macros`Evaluation`PackagePrivate`r$], !MatchQ[Macros`Evaluation`PackagePrivate`r$, Macros`$FailRHS | Macros`HoldSequence[Macros`$FailRHS]]]];
  2. Effectively:
  3. ToCamelCase[n_] := GeneralUtilities`Strings`PackagePrivate`iToCamelCase/@n;
  4. Now:
  5. GeneralUtilities`Strings`PackagePrivate`iToCamelCase[n_] := StringJoin[Capitalize /@ ToLowerCase /@ StringSplit[n, " "]];
  6. Effectively:
  7. GeneralUtilities`Strings`PackagePrivate`iToCamelCase[n_] := ""<>Capitalize/@ToLowerCase/@StringSplit@n;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement