Questions tagged [textutils]
28 questions
6
votes
5 answers
Fill placeholders in file in single pass
I have a skeleton text file with placeholder strings:
blah blah blah
blah $PLACEHOLDER_1$
blah
$PLACEHOLDER_2$
and so on. Specific "form" of placeholders does not matter -- I may change them to whatever most comfortable for specific…

Alexander Gladysh
- 39,865
- 32
- 103
- 160
5
votes
2 answers
For what purpose is Android TextUtils used?
I was wondering - "why do others use TextUtils in many purposes?" - but I am not clear about this. The Developer site says that it is a simple string splitter. I understand this but I don't know how to use this in a practical manner or what purposes…

androidcodehunter
- 21,567
- 19
- 47
- 70
4
votes
7 answers
Kotlin: isNullOrEmpty vs TextUtils.isEmpty
In Kotlin (Android project), which is preferable to use ?
isNullOrEmpty or TextUtils.isEmpty and why
I believe they do the exact thing and are "null" safe, right ?

thahgr
- 718
- 1
- 10
- 27
4
votes
1 answer
Proper use for TextUtils.commaEllipsize
I'm looking for some sample code on how to use this correctly with a TextView.
the only thing I found in my Google searching was this test unit for the TextUtils class.
some guidance will be much appreciated.
EDIT:
I looked over the answer I got…

thepoosh
- 12,497
- 15
- 73
- 132
4
votes
2 answers
batch process docx to markdown
Any ideas on how I can get:
textutil -convert html file.doc -stdout | pandoc -f html -t markdown -o file.md
so that I can execute the command on a folder and all it's subfolders and so that the markdown file is placed in the same folder as the…

rev
- 623
- 1
- 7
- 16
3
votes
1 answer
How can I make GNU sort put uppercase letters first?
I want everything else to remain identical, only have uppercase letters come first.

user2958725
- 1,355
- 3
- 12
- 16
2
votes
1 answer
CodenameOne - encoding HTML string
My CodenameOne app needs to pass HTML code to HTML elements inside a BrowserComponent with Javascript, so characters have to be escaped more than one time, they have to be encoded in fact.
I need something like TextUtils.htmlEncode().
In Codename it…

P5music
- 3,197
- 2
- 32
- 81
2
votes
1 answer
Android TextUtils.split to deliver a fixed length string[]
I cannot get a string broken into fixed length chunks and added to an ArrayList ... the code below iterates through as expected, but all the messageToSplit[] upto the last one are null. The last one actually has a value in it.
In the example below…

Bill Mote
- 12,644
- 7
- 58
- 82
1
vote
1 answer
Output multiple converted files to custom directory using textutil
I need to batch convert multiple docx files to txt files and place them in a custom directory using textutil.
It seems I can do this with a single file, but not with multiple files. If I set an -output path while converting multiple files, it will…

Evan Meredith-Davies
- 198
- 1
- 3
- 15
1
vote
5 answers
Search and replace in Shell
I am writing a shell (bash) script and I'm trying to figure out an easy way to accomplish a simple task.
I have some string in a variable.
I don't know if this is relevant, but it can contain spaces, newlines, because actually this string is the…

Anonymous
- 3,011
- 4
- 24
- 23
1
vote
0 answers
Grep not recognising all newlines
I'm totally new to scripting - so new in fact that most of what I do script ends up being put in Mac's Automator as 'Run Shell Script.' So please forgive, well, everything.
Basically, I am building a web-corpus. So, I'm downloading .html files from…

user2437842
- 139
- 1
- 10
1
vote
2 answers
Missing TextUtils from Struts2 Library
My project was using older versions of Struts2 (2.0.x)
Now we are planning to upgrade Struts2 version which has some improvements and bug fixes.
I updated the pom.xml as per that. However I found out that in my old strtus2-core lib, there's…

RaceBase
- 18,428
- 47
- 141
- 202
1
vote
2 answers
Android Method TextUtils.regionMatches
I has found this android method TextUtils.regionMatches
But for some reason, so it is not clear how this function works.
The function can be found…

FIG-GHD742
- 2,486
- 1
- 19
- 27
0
votes
1 answer
I was learning django and I dont understand what's happening here, what is the logic
if removepunc == "on":
punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~'''
analyzed = ""
for char in djtext:
if char not in punctuations:
analyzed = analyzed + char
params = {'purpose':'Removed Punctuations',…

Amrit
- 3
- 4
0
votes
0 answers
Initialising a string in setOnClickListener body causes the button to not work
I've made a signup activity in android development which is supposed to make an account in the app using the given credentials.
Here's the original code:
signUpBtn.setOnClickListener(new View.OnClickListener() {
@Override
…

Maitreyi Paweria
- 1
- 1