Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

getPlayers filter name with spaces

Featured Replies

getPlayers().filter(p -> p.getName().toLowerCase().equals("nospace"));

This works fine - the player if found if they're nearby.

getPlayers().filter(p -> p.getName().toLowerCase().equals("name with space"));

This seems to work randomly - some names work and others don't. Does anyone have any idea why that could be?

Edited by Ragnar Lothbrok

Some of the spaces are \u00a0 instead of a space, try this:

p.getName().toLowerCase().replaceAll("\u00a0", " ").equals("other player")

 

Edited by ThatGamerBlue

  • Author
8 minutes ago, ThatGamerBlue said:

Some of the spaces are \u00a0 instead of a space, try this:


p.getName().toLowerCase().replaceAll("\u00a0", " ").equals("other player")

 

Why would some names be like this and not others - doesn't make much sense but I'll give it a go thanks!

21 minutes ago, Ragnar Lothbrok said:

Why would some names be like this and not others - doesn't make much sense but I'll give it a go thanks!

Cause \u00a0 is a non breaking space, as in if its at the end of the line it blocks the text editor from breaking the word. In other words, non breaking space is counted as a part of the word.

Also it should be username.replaceAll("\\u00a0", " ") because you need to escape the back slash.

Edited by Vilius

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.