Questions tagged [charsequence]

In Java (and related languages such as Scala), java.lang.CharSequence is an interface to sequences of character values.

For more information, see the Java 8 specification of CharSequence.

146 questions
2
votes
3 answers

Combining two CharSequence variables

Can I combine two CharSequence variables like this? if (status == 1) { for (int i = 0; i < get.length(); i++) { if (get.charAt(i) == ')') { } else { temp = temp.toString() + get.charAt(i); // temp and…
Muneeb
  • 63
  • 1
  • 9
2
votes
1 answer

CharSequnce variable.toString() returns empty

I have a list item. Each item extends Textview to create my customized item. In this class I override the setText(CharSequence text, BufferType type) method to do processing on text before I call super.setText(Charsequence text, BufferType…
Rasoul Taheri
  • 802
  • 3
  • 16
  • 32
1
vote
0 answers

stringbuffer vs charsequence android

I would like to know how to put it in a stringbuffer after reading it using charsequence? Here is my code: StringBuffer data=new StringBuffer(); File f= new File(Environment.getExternalSTorageDirector+"/file.pdf"); FileInputStream fileIS= new…
user1222905
  • 533
  • 2
  • 17
  • 36
1
vote
4 answers

Writing CSV file. myPackage.MyClass cannot be cast to java.lang.CharSequence

I need to write List myList into CSV file. In particular I need to write values. MyClass has the following implementation: public class MyClass { private Object[] values; //... @Override public String toString() { …
You Kuper
  • 1,113
  • 7
  • 18
  • 38
1
vote
2 answers

Android: From StringArray Resources To CharSequence[]

I guess this is a pretty newbie question, but I've spent only 2 weeks on Android. My question is, I have a StringArray created with a reference R.array.NAME I want to populate a Dialog full of checkboxes with the values from the StringArray, but it…
Sento
  • 171
  • 5
  • 13
1
vote
1 answer

What is the difference between chars() and codePoints() method in CharSequence interface?

I read javadoc, but don't understand the differences, both of them return same result. Also can anyone explain what is 'zero-extending' means? Javadoc of chars() method Returns a stream of int zero-extending the char values from this sequence. Any…
1
vote
1 answer

Correct way to remove last grapheme of CharSequence

The code: val plainText = "plainText" val plainTextWithEmoji = "plainText" println("plainText=$plainText, length=${plainText.length}") println("plainTextWithEmoji=$plainText, length=${plainTextWithEmoji.length}") // Output: // plainText=plainText,…
ZSpirytus
  • 339
  • 2
  • 10
1
vote
1 answer

Add data to CharSequence dynamically

I have the following code to display a list of clickable items (user can choose more than one item) return new AlertDialog.Builder(this) .setTitle("Users") .setMultiChoiceItems(csUser, _selections, new…
JPBoucher
  • 49
  • 1
  • 4
1
vote
1 answer

Difference between "CharSequence interface" and "CharSequence key"

Actions act = new Actions(driver); act.keyDown(CharSequence key); If I search online to find out what CharSequence is, I get all the information about the CharSequence interface. I can't understand what does a CharSequence interface has to do with…
zara
  • 99
  • 1
  • 8
1
vote
1 answer

Duplicate and incorrect result trying to append String to Custom StringBuilder

I'm trying to append a String to StringBuilder I have the code setup. This is what I am inputting this = "is"\na = "test" This is the output I'm getting this = "is" this = "is" a = "test" my expected output is this = "is" a =…
user8193104
1
vote
3 answers

What's the C# equivalent of Java CharSequence type?

I'm working on converting a Java project to C#, but don't know what CharSequence is corresponding to C# type.
superche
  • 753
  • 3
  • 9
  • 21
1
vote
2 answers

Is it possible to save a CharSequence in Firestore?

Is possible to save a CharSequence variable into Firebase? Checked out: Supported Data Types, but charsequence is not there... I'm getting serializable problems related to this, tried: pro-guard rules, public attributes, implements serializable,…
user8934311
1
vote
1 answer

How to store and pass CharSequence by setter and getter?

I have a DepositTypes class with CharSequence array as a parameter. I used setter and getter for CharSequence depositPeriod[]. In generatePeriod() I have to generate some random numbers and save them to depositPeriod[] for each item of the…
Abdugani_T
  • 83
  • 1
  • 11
1
vote
1 answer

onClick validation error while going to another activity

i am quite new to android programming and i can't figure out what is the problem here. i have a registration form that validates before sending register info and going to another activity. Form validate is working if false, but when all fields are…
majstore
  • 31
  • 1
  • 3
1
vote
1 answer

Why am I getting a java.lang.Charsequence cannot be applied to a char error?

}else if(readUserEmail.contains('a')){ System.out.print("true"); Why am I getting a java.lang.Charsequence cannot be applied to a char error? In this case readUserEmail is a string of an email.
eli
  • 335
  • 1
  • 3
  • 18