Friday 5 June 2015

Convert String To Title Case With Jquery And Title Case Microsoft Office

Hello All,


This My learn how to change title case using jquery. I am also Learn that how to
change title case in MsOffice.

When I have Text  TO HAVE A CLEAR AND FOCUSSED CONTENT  in MsOfiice
I am want to change it into To Have A Clear And Focussed Content. I have no Idea 
about that. I am also don't what to say in MsOffice that's I want to make code in jquery.

I have change manually but  I thought if I have many of text that I do code. I also Find instruction

in Msoffice.

It That


  1. Select the text you want to alter.
  2. Press Shift+F3. Word changes the case of the selected text.
  3. Continue pressing Shift+F3 until the case is the way you want it.

When First i select text TO HAVE A CLEAR AND FOCUSSED CONTENT and press shift+f3
it make it Small. after again press Shift+f3. Then Get this text To Have A Clear And Focussed Content.

So I think When Get code Also using Jquery then  I Will Put here and try some one
who can khow developing.



<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    
    var text = $('.capitalize').text();
    
    var ti = toTitleCase(text);

      $('.capitalize').empty();
      $('.capitalize').append(ti);
    function toTitleCase(str)
{
    return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}

});
</script>
<div class='capitalize'>
    TO HAVE A CLEAR AND FOCUSSED CONTENT
</div>

in div you can put your text and check in your browser you can get output.



1 comment:

Thank You For Comment