From 88f205aab9167aeae720b657986bae5fe8b593e6 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Tue, 25 Jun 2019 21:55:46 +0200 Subject: Add Title Case action --- src/me/laria/code/idea_caseconv/TitleCaseAction.java | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/me/laria/code/idea_caseconv/TitleCaseAction.java (limited to 'src/me/laria/code') 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))); + } +} -- cgit v1.2.3-70-g09d2