Ditto is an extension to the Windows Clipboard. You copy something to the Clipboard and Ditto takes what you copied and stores it in a database to retrieve at a later time.
I have input like last, first m and I want to convert it to first m last. So I am trying to use regex to extract the various parts and put it together but it's not returning the output I would expect.
var original = clip.GetAsciiString();
clip.AsciiTextReplaceRegex(",.*$", "");
var lastPart = clip.GetAsciiString();
clip.SetAsciiString(original);
clip.AsciiTextReplaceRegex("^.*?,", "");
var firstPart = clip.GetAsciiString();
var together = firstPart + " " + lastPart;
clip.SetAsciiString(together);
return false
get the clip
replace the first comma and everything after it
save this string
set clip back to original string
replace everything up to the first comma
save this string
put the two strings together
set the clip to the new string
But in my sample input test, it does not output anything.
I have input like
last, first m
and I want to convert it tofirst m last
. So I am trying to use regex to extract the various parts and put it together but it's not returning the output I would expect.But in my sample input test, it does not output anything.