uppercase

Uppercase or Lowercase a specific character in a word “Java”

纵然是瞬间 提交于 2019-12-25 11:51:27
问题 I have look into most of questions but I couldn't find how to uppercase or lowercase specific character inside a word. Example: String name = "Robert" What if I would like to make "b" Uppercase and rest lowercase also how to make first letter Uppercase and rest lowercase? Like "john" >> Output >> "John"... I have toUppercase() and toLowercase() . They convert the whole text. Also I tried to include charAt but never worked with me. 回答1: You will need to take your string, take a substring of

Uppercase a string input from scanner in java

老子叫甜甜 提交于 2019-12-25 08:35:59
问题 I am supposed to use the Scanner in Java to receive a 14 char input and have all the letter char output in uppercase format. I've tried entering some of the code I found through Google such as " str.toUpperCase(Locale.ENGLISH); " but it tells me str cannot be resolved and that the locale can't be resolved. When I did a search on here I got results for uppercasing specific char or counting char. I just need the specific line of input to be uppercased. The following is what I have at the moment

Converting Lower Case to Upper case in Intel 8086 Assembly. If Already in Upper Case DO_NOTHING and continue SAVING

倖福魔咒の 提交于 2019-12-25 05:19:14
问题 ;I created this program (Intel 8086 Assembly) to read characters and store them and print ;them in reverse order after converting them to Upper Case. I know you can convert to upper ;case using (sub AL, 20h) but how do I put the conditional (IF) Loop ? org 100h mov BX, 0800h mov DS, BX ;Set segment register mov BX, 0000h ;Set offset register mov CX, 0 ;Set counter to 0 ;mov CH, 0 readwrite: ;Top of read/write loop mov AH, 01h ;Get ready to read a character int 21h ;Read character into AL ;jb

How to transfer characters between uppercase and lowercase with sed

泄露秘密 提交于 2019-12-25 02:46:53
问题 For example, my src.tex is SectionType *p = NULL; and I want it change to section_type *p = NULL; what I want to do is just change the SectionType , but remains the NULL unchanged, I used y/[A-Z]/[a-z] , but this will change all the line. My sed do not support \L,\l,\U and \u functions, it version is 3.* and distributed under FSF, not GNU, may be GNU's works well with this functions, but at the time I could not adopt the GNU's because I'm working in msys and there is no GNU package. Is there

How to change a form input text to uppercase using a JavaScript function

耗尽温柔 提交于 2019-12-24 20:34:41
问题 I'm trying to change a form input field (username) to uppercase and to remove all spaces within the text. I know there are a few ways one could do this but I need to figure out how to do this using a function. I need to get the input by it's id and use the toUpperCase method but I cannot figure this out for the life of me. As you might be able to tell, I am new to JavaScript. Any help would be greatly appreciated. Thank you. HTML: <div class="login-form"> <h1 class="h1-login">Welcome</h1> <h4

VBscript: how to Uppercase specific parts of text in a string, outside of quotes ('s)

青春壹個敷衍的年華 提交于 2019-12-24 18:09:10
问题 i need your help. in vbscript i have a string such as s = 'Abc' and 'Def' Or 'Ghin' In 'jkl' not 'mnoR' And ... or ... NOT ... iN ... and i want to uppercase these specific 4 operators (in any combination of lower and upper text): and, or, in, not, to Uppercase. These operators exist outside the quotes (') - because between them i have business rules. This is important, because, as you can see in 3rd rule ('Ghin') i have 'in' in the name of the rule and in these cases i do not want the text

Uppercase in C language

点点圈 提交于 2019-12-24 07:48:40
问题 I have this code: void changeToCapital(char* str) { int i; for (i=0; i<strlen(str); i++) { str[i] =str[i] -32; } } and this method is supposed to get a char* variable, and change it to its uppercase. For some reason I'm getting an error saying EXECUTE_BAD_ACCESS . The calling function: char* s = "itzik"; changeToCapital(s); printf("%s\n",s); What am I doing wrong here? 回答1: This is most likely because you are passing it a pointer to non-writable memory, such as one obtained from a string

How to check if a string is a letter(a-z or A-Z) in c

别说谁变了你拦得住时间么 提交于 2019-12-24 06:35:02
问题 I am getting user input, and I want to determine if the user has entered a letter , an integer, or an operator. I can successfully determine if it is an integer using sscanf, but I am stumped on how to determine if it is a letter. By letter, I mean: A-Z, a-z. int main(){ char buffer[20]; int integer; printf("Enter expression: "); while (fgets(buffer, sizeof(buffer), stdin) != NULL){ char *p = strchr(buffer, '\n'); //take care of the new line from fgets if (p) *p = 0; //Buffer will either be a

How to only allow capital letters in Java GUI?

让人想犯罪 __ 提交于 2019-12-23 20:03:06
问题 I want to be able to input only capital letters to my GUI and so I just need the easiest way to cap/stop people from entering lowercase. JTextField jt = new JTextField(12); 回答1: Use a DocumentFilter Take a look at Implementing a Document Filter for details and MDP's Weblog for examples import java.awt.EventQueue; import java.awt.GridBagLayout; import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import

Zend framework: “url not found” only with index controller, only if lowercase

不羁岁月 提交于 2019-12-23 12:26:42
问题 This is my problem: I have a working zend application running on aruba/linux. It seems to work well. I have some controllers: index, user, video, ... if i type "http://www.foo.com/public/" i can reach my index controller and index action. if i type "http://www.foo.com/public/user/register" i can reach my user controller and register action. if i type "http://www.foo.com/public/index/index" the server return url not found :( But the most strange thing is that if i type "http://www.foo.com