charat Questions

3

What is the difference between the "String.charAt()" method and the "String.at()" method? I tried to understand how they work, but other than the fact that the "at" me...
Reachmedown asked 21/3, 2023 at 23:49

2

Solved

I am trying to create a function in which after toLowerCase() input, will then capitalize the first letter in each element of an array. function title_case ( String ) { var result = ""; var text...
Clammy asked 21/4, 2018 at 1:19

4

Solved

I am attempting to solve a problem where I create a method that counts the number of occurrences of capital and lowercase ("A" or "a") in a certain string. I have been working on this problem for a...
Bridegroom asked 27/4, 2017 at 2:12

5

Solved

I have seen various comparisons that you can do with the charAt() method. However, I can't really understand a few of them. String str = "asdf"; str.charAt(0) == '-'; // What does it mean when it...
Uroscopy asked 17/10, 2016 at 12:1

2

Solved

I have a function that emulates typing with few lines of basic JavaScript code, however it appends text, but I want to prepend text to the element before any other already existing text/elements wi...
Vaporization asked 7/3, 2014 at 21:17

8

I saw a comment here that all solutions with charAt are wrong. I could not exactly understand and find something about charAt on internet. As I look the source code it just returns an element from ...
Repine asked 14/3, 2016 at 13:25

3

Solved

function SimpleSymbols(str) { var letter =['a','b','c','d','e','f','g','h','i','j', 'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; var newstr = ""; for (var i = 0; i<str...
Trueman asked 25/8, 2014 at 16:9

3

Solved

I'm working through the problems on Codingbat.com and bumped into the fact that for the += operator, a += b isn't necessarily exactly equal to a = a + b. This is well known and has been discussed o...
Heliacal asked 24/7, 2014 at 15:54

3

Solved

Code: public void placeO(int xpos, int ypos) { for(int i=0; i<3;i++) for(int j = 0;j<3;j++) { // The line below does not work. what can I use to replace this? if(position[i][j]==' ') { ...
Monosaccharide asked 1/2, 2014 at 19:57

2

Solved

I want something like the following in Javascript if str.charAt(index) (is in the set of) {".", ",", "#", "$", ";", ":"} Yes, I know this must be simple, but I can't seem to get the syntax right....
Steffi asked 27/1, 2014 at 14:57
1

© 2022 - 2024 — McMap. All rights reserved.