aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2019-06-25 21:55:46 +0200
committerLaria Carolin Chabowski <laria@laria.me>2019-06-27 07:55:09 +0200
commit88f205aab9167aeae720b657986bae5fe8b593e6 (patch)
tree25f25b4f53800484ba7674d40a160322757fd024 /src
parentb8ee85038e1d42503a4359d6476595181b7afe38 (diff)
downloadidea_caseconv-88f205aab9167aeae720b657986bae5fe8b593e6.tar.gz
idea_caseconv-88f205aab9167aeae720b657986bae5fe8b593e6.tar.bz2
idea_caseconv-88f205aab9167aeae720b657986bae5fe8b593e6.zip
Add Title Case action
Diffstat (limited to 'src')
-rw-r--r--src/me/laria/code/idea_caseconv/TitleCaseAction.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/me/laria/code/idea_caseconv/TitleCaseAction.java b/src/me/laria/code/idea_caseconv/TitleCaseAction.java
new file mode 100644
index 0000000..70024c3
--- /dev/null
+++ b/src/me/laria/code/idea_caseconv/TitleCaseAction.java
@@ -0,0 +1,10 @@
+package me.laria.code.idea_caseconv;
+
+import java.util.Optional;
+
+public class TitleCaseAction extends SelectionReplacerAction {
+ @Override
+ protected String replace(String s) {
+ return WordSplitConverter.convert(s, " ", (i, part) -> Optional.of(CamelCaseAction.ucfirst(part)));
+ }
+}