Questions tagged [lastindexof]
125 questions
-2
votes
1 answer
Printing Last Index of a String without using lastIndexOf()
Good Afternoon,
I want to write a method that reaches(asks) two strings and checks whether String2 is in String1 case. If s2 is in s1 it returns the index of
the last occurrence of String2, otherwise it returns -1. It's easy by using lastIndexOf()…

Firat
- 381
- 1
- 5
- 17
-2
votes
1 answer
Using split("\\.") crashes my android app (libGDX)
I'm using libGDX and I got a huge problem with the split method. I'm working on a skillsystem for a game right now in which the player can choose 2 skills at the beginning of the game. The 2 chosen skills are displayed ingame as a button.
So here's…

novas1r1
- 1,803
- 21
- 28
-3
votes
1 answer
I cant understand this lastindexof method in Java 11- version2
public class Test2{
public static void main(String[] args) {
String str="this is how";
int a0=str.lastIndexOf("is");
int a=str.lastIndexOf("is",0);
int b=str.lastIndexOf("is",1);
int c=str.lastIndexOf("is",2);
int…

alex K
- 81
- 1
- 1
- 5
-3
votes
1 answer
StartIndex cannot be less than zero Getting Error
I have a button to delete the last line in a multi text box. It works so far, deletes everything in the last line just how I want. Here is the code for that
private void Button1_Click(object sender, EventArgs e)
{
…

aangel10
- 1
- 2
-4
votes
1 answer
Getting string from another string in Javascript
Please note that this is not a json object :) My string is:
{"message":"***error in SAP module:-1***","status":400}
This is not a json object, this is a pure string. I cannot turn it into a json object due to technical limitations.
So, I want to…

Erez
- 502
- 3
- 6
- 17