Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Caso de título jQuery

¿Hay una forma integrada con jQuery para "titular el caso" de una cadena? Entonces, dado algo como bob smith, ¿se convierte en "Bob Smith"?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

No necesita jQuery para esto; se puede lograr usando el método nativo .replace() :

 function toTitleCase(str) { return str.replace(/(?:^|\s)\w/g, function(match) { return match.toUpperCase(); }); } alert(toTitleCase("foo bar baz")); // alerts "Foo Bar Baz"
over 4 years ago · Santiago Trujillo Report

0

Puedes usar css, como:

 .className { text-transform:capitalize; }

Esto pone en mayúscula la primera letra. Puedes leer más aquí

over 4 years ago · Santiago Trujillo Report

0

En jQuery 1.4+ (al menos) puedes usar

 var camelized = jQuery.camelCase("some-string"); // Returns "someString"

No pude encontrarlo la última vez que revisé la documentación, pero está ahí y se usa internamente.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!