Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:06:21+00:00 2026-05-26T01:06:21+00:00

I am trying to see if I can remove some characters from the string

  • 0

I am trying to see if I can remove some characters from the string that the below script creates:

$(".fileName").text()

The string that is created will be something like:

"bottom.gif (0.43KB)"

I want the string to be: “bottom.gif”

the issue:
the image name can be anything. The size of the image will also varry. The only constant that I have to work with are:
space after the image name
“(” before the file size
“)” after the file size

Any help would be great!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:06:22+00:00Added an answer on May 26, 2026 at 1:06 am
    var text = $(".fileName").text().split(' (')[0];
    

    Example here

    It splits the text string into an array everywhere this string ‘ (‘ occurs:

    text[0] = "bottom.gif" 
    text[1] = "0.43KB)"
    

    and you need only text[0] for use.

    note: If the ‘ (‘ doesn’t exist it will return the whole string:

    var text = $(".fileName").text().split('_')[0];
    
    text[0]="bottom.gif (0.43KB)"
    text[1]  error
    

    so it is safe to use it with [0] and no check if the value is null.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to filter out some garbage text from a string with regex but
Trying not to lose it here. As you can see below I have assigned
I'm trying to secure an application so that users can only see objects which
Can't seem to figure this out, see code below. Trying to make a GET
I am trying to see if the performance of both can be compared based
I am trying to see which button was clicked on so I can preform
For fun I am trying to see how far I can get at implementing
Im trying to use this page slider jquery plugin, you can see the demo
I am trying to create 100 files using FileOutputStream/BufferedOutputStream. I can see the CPU
Trying to convert the following but am having difficulty. Can anyone see where I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.