uppercase

I need to uppercase all characters of Android textview

删除回忆录丶 提交于 2020-01-06 13:53:01
问题 I know about using setAllCaps(true) but it requires me to use API14 as min, and I would like to keep API 9 as min, so I would like to know if anyone has found a way to capitalize all characters of all textViews in certain layout? 回答1: One could easily extend the TextView and change the text case there manually. Example: package com.example.allcapstextview; import android.content.Context; import android.util.AttributeSet; import android.widget.TextView; import java.util.Locale; public class

XSLT Can't match element with specific namespace

杀马特。学长 韩版系。学妹 提交于 2020-01-06 13:09:43
问题 I have this XML source file: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="c:\ISO19139_rve.xsl"?> <MD_Metadata xmlns="http://www.isotc211.org/schemas/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/schemas/2005/gco" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.isotc211.org/schemas/2005/gmd/gmd.xsd"> <identificationInfo> <MD_DataIdentification> <extent> <EX

python uppercase and ascii in persian text

非 Y 不嫁゛ 提交于 2020-01-05 20:00:54
问题 I change this code to work in persian. My code returns: Key: Text is too short to analyze Text: and doesn't return key and decrypt text. Is it anything wrong with uppercase or ascii in persian text? What can I do? # -*- coding: utf-8 -*- from string import uppercase from operator import itemgetter def vigenere_decrypt(target_freqs, input): nchars = len(uppercase) ordA = ord(u"ا") sorted_targets = sorted(target_freqs) def frequency(input): result = [[c, 0.0] for c in uppercase] for c in input:

TextView.setAllCaps() equivalent in API older than 14?

怎甘沉沦 提交于 2020-01-05 08:35:13
问题 TextView.setAllCaps() started as of API 14. What is its equivalent for older APIs (e.g. 13 and lowers)? I cannot find such method on lower APIs. Is maybe setTransformationMethod() responsible for this on older APIs? If yes, how should I use it? TextView.setTransformationMethod(new TransformationMethod() {... is a bit confusing. 回答1: Try this: textView.setText(textToBeSet.toUpperCase()); 回答2: What about oldskool strtoupper() ? 回答3: Bottom line is that toUpperCase() is the solution. I can't

Swapping uppercase and lowercase in a string

寵の児 提交于 2020-01-03 14:01:23
问题 I would like to change the chars of a string from lowercase to uppercase. My code is below, the output I get with my code is a ; could you please tell me where I am wrong and explain why? Thanks in advance test = "AltERNating" def to_alternating_case(string): words = list(string) for word in words: if word.isupper() == True: return word.lower() else: return word.upper() print to_alternating_case(test) 回答1: If you want to invert the case of that string, try this: >>> 'AltERNating'.swapcase()

JavaScript replace lowercase uppercase

橙三吉。 提交于 2020-01-03 05:19:51
问题 I want to replace something (variable -> I call it "x" here) in a text (variable) with 'string'+x+'string'. My code: new_content = content.replace(new RegExp(x,"gi"),'string'+x+'string'); So I want to replace upper and lowercase x and the x in 'string'+x+'string' should be lowercase if the search x is lowercase as well. And the same thing for uppercase. Is there a way like $1 for this situation? 回答1: You can use $& in the replacement string to insert the matched string: new_content = content

How to convert from lower to upper case in Sublime 3

坚强是说给别人听的谎言 提交于 2020-01-02 00:42:28
问题 Is there a shortcut or function for upper/lower-casing the selected text in Sublime 3? 回答1: if you need convert any text, select and press: ctrl + KU 回答2: If you go to the Edit menu and select Convert Case you'll find several options, with the appropriate shortcuts listed next to them. Additionally, the Case Conversion plugin, available through Package Control, adds a number of additional options to this menu for converting variables, such as snake_case , camelCase , PascalCase , dot.case ,

Automatically capitalize first letter of first word in a new sentence in LaTeX

一个人想着一个人 提交于 2020-01-01 02:35:09
问题 I know one of LaTeX's bragging points is that it doesn't have this Microsoftish behavior. Nevertheless, it's sometimes useful. LaTeX already adds an extra space after you type a (non-backslashed) period, so it should be possible to make it automatically capitalize the following letter as well. Is there an obvious way to write a macro that does this, or is there a LaTeX package that does it already? 回答1: The following code solves the problem. \let\period. \catcode`\.\active \def

How to replace uppercase letters to lowercase letters using regex in Eclipse?

旧巷老猫 提交于 2019-12-31 17:54:14
问题 I'd like to go through all of my source code files and replace every occurence of k_Xyyy with k_xyyy (switch the first letter after k_ from uppercase to lowercase). I'm using the eclipse dialog to search and replace multiple files. Right now I have the regex \bk_([A-Z]) . How do I specify the replacement string of the regex? 回答1: That is not possible. Either use Eclipse's re-factoring functionality, or replace them one at a time: regex : \bk_A replacement : k_a regex : \bk_B replacement : k_b

Two conditions using OR in XPATH

北城以北 提交于 2019-12-28 03:01:31
问题 I have a textbox, 'txtSearch'. I am using it to search people by Last Name. this is my code. var xmlTempResultSearch = xmlResidentListDisplay.selectNodes( "//PeopleList/Row[contains(translate(@LastName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '" + txtSearch.value + "')]"); This code selects all last names in the XML like the text input in the txtSearch textbox. This translates all uppercase letters to lowercase letters. So if I am searching for 'Dorosan', if I type 'doro'